oh man im so shit at this lol
ok, so vB4.2.2 and editing in postbit template The field i've created is gender with 2 options male or female. http://s9.postimg.org/5qp9yvmf3/Scre...t_06_38_27.png Here is the code i've got in there. Its not working and i bet one of you guys will take 1 look and it will be so obvious lol https://vborg.vbsupport.ru/external/2014/04/1.png |
It's "field7", not "Field7".
|
<vb:if condition="$post['field7']"><dt>Gender</dt> <dd>{vb:raw post.field7}</dd></vb:if>
Not working |
Take off the conditionals so you just have this:
Code:
<dt>Gender</dt> <dd>{vb:raw post.field7}</dd> This is really a test that you are editing the correct template in the correct style, since now, even if your field id was wrong you should at least see "Gender" in the postbit. |
Are you sure the poster has even set the gender in their profile?
|
Quote:
--------------- Added [DATE]1399059505[/DATE] at [TIME]1399059505[/TIME] --------------- AHHHH, i was editing 'postbit' not 'postbit_legacy' |
Quote:
Quote:
|
Have been trying to use method 2 ...
This works >>>> if ($post[field40]) { $ImagePath = vB_Template_Runtime::fetchStyleVar('imgdir_misc'). '/critique/nocritique.png'; $template_hook['postbit_userinfo_right_after_posts'] .= '<br /><dt>Critique Level</dt><br /> <dd><img src="' . $ImagePath . '"/></dd>'; } Yielding both Critique Level: and an image. Adding conditional doesn't, if there is just one conditional I get Critique Level: and a broken image link; the only difference is the "& 4" - If I use with three conditionals I get 3 * Critique Level: s and 3 broken image links .... It also seems as though it is ignoring the "if" statement because it shows on every profile.>>>> if ($post[field40]) { if ($post[field40] & 4) $ImagePath = vB_Template_Runtime::fetchStyleVar('imgdir_misc'). '/critique/nocritique.png'; $template_hook['postbit_userinfo_right_after_posts'] .= '<br /><dt>Critique Level</dt><br /> <dd><img src="' . $ImagePath . '"/></dd>'; } I can hazard a guess that using three conditionals there could be a confusion over $ImagePath, but surely it should work with just the one condition ? I'm missing something rather simple I think ?! |
You need some parenthesis after your second condition (why are you using a second one anyway?).
Code:
if ($post[field40]) |
Not too sure what you mean by "why am I using a second condition...."
I'm following your method 2 : Quote:
[field40] contains 3 radio buttons. Looks like I need to keep hammering at it .... |
All times are GMT. The time now is 05:33 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|