View Full Version : Adding Profile fieldss to Postbit
RichieBoy67
02-03-2014, 09:19 PM
I have added conditionals that display some new profile fields in my postbit_legacy template. The problem I am having is making these fields show up when the member has not yet added any info. I know this should be easy but I am doing something wrong.
I need the field to show up so members know they can add their info.
Thanks,
Rich
ozzy47
02-03-2014, 09:37 PM
What is the code you are currently using?
RichieBoy67
02-03-2014, 10:12 PM
Thanks, right now just the basic conditional
<vb:if condition="$post['field7']"><dt>Height</dt> <dd>{vb:raw post.field7}</dd></vb:if>
ozzy47
02-03-2014, 10:28 PM
Try something like this:
<vb:if condition="$post['field7'] != ''">
<dt>Height</dt> <dd>{vb:raw post.field7}</dd>
<vb:else />
<dt>Edit Your Profile to fill in information</dt>
</vb:if>
You can change, Edit Your Profile to fill in information to suit your needs.
RichieBoy67
02-03-2014, 10:32 PM
I actually tried something like that but I did not add text. I may have messed up though,
I will try this,
Thanks Ozzy!
#Update - ok, I see what I did before. In the else statement I put ___ thinking it would show Height___ if the info was not added. I should have just put Height in the text field. Doh Thanks again
ozzy47
02-03-2014, 10:40 PM
No problem, glad it's working now. :)
RichieBoy67
02-03-2014, 11:19 PM
I had it working but alignment was messed up. I have a few fields I want members to see so they know they can enter their info. I may need to do a little more work to get it to display properly.
ozzy47
02-03-2014, 11:21 PM
What is the alignment issue? Perhaps a link so I can see what you got going on live.
RichieBoy67
02-03-2014, 11:32 PM
Sure,
https://vborg.vbsupport.ru/external/2014/02/1.bmp
when filled it looks like this
https://vborg.vbsupport.ru/external/2014/02/2.bmp
I don't have a link because I put the standard conditional back while i figure it out.
ozzy47
02-03-2014, 11:38 PM
Here ya go:
<vb:if condition="$post['field7'] != ''">
<dt>Height</dt> <dd>{vb:raw post.field7}</dd>
<vb:else />
<dt style="padding-left:10px;">Height</dt>
</vb:if>
Adjust 10px as needed. :)
RichieBoy67
02-03-2014, 11:52 PM
Thanks,
I just had this and was working on it. You are way faster though! thanks for the help!
ozzie came up with the fix. The above still had alignment issues.
<vb:if condition="$post['field7'] != ''">
<dt>Height</dt> <dd>{vb:raw post.field7}</dd>
<vb:else />
<dt style="padding-left:10px;">Height</dt><dd> </dd>
</vb:if>
ozzy47
02-03-2014, 11:53 PM
Not a problem, glad to help. :)
ozzy47
02-04-2014, 01:20 AM
Should anyone else run across this, this was the final edit:
<vb:if condition="$post['field7'] != ''">
<dt>Height</dt> <dd>{vb:raw post.field7}</dd>
<vb:else />
<dt style="padding-left:10px;">Height</dt><dd> </dd>
</vb:if>
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.