Skip to Content Skip to Menu

CB if statement usage help

13 years 1 month ago #180137 by busterocaps
CB if statement usage help was created by busterocaps
Why doesn't this work:
Code:
[cb:if [cb:userfield field="cb_rank"]="Recruit"/] <img src="components/com_comprofiler/images/recruit.png" alt="Recruit" /> [/cb:if] [cb:if [cb:userfield field="cb_rank"]="Private"/] <img src="components/com_comprofiler/mages/pvt.png" alt="Private" /> [/cb:if] [cb:if [cb:userfield field="cb_rank"]="Corporal"/] <img src="components/com_comprofiler/images/Cprl.png" alt="Corporal" /> [/cb:if] [cb:if [cb:userfield field="cb_rank"]="Sergeant"/] <img src="components/com_comprofiler/images/Sgt.png" alt="Sergeant" /> [/cb:if] [cb:if [cb:userfield field="cb_rank"]="Master Sergeant"/]<img src="components/com_comprofiler/images/Master Sgt.png" alt="Master Sergeant" /> [/cb:if] [cb:if [cb:userfield field="cb_rank"]="Lieutenant"/] <img src="components/com_comprofiler/images/LT.png" alt="Lieutenant" /> [/cb:if] [cb:if [cb:userfield field="cb_rank"]="Captain"/] <img src="components/com_comprofiler/images/captain.png" alt="Captain" /> [/cb:if] [cb:if [cb:userfield field="cb_rank"]="Council"/] <img src="components/com_comprofiler/images/council.png" alt="Council" /> [/cb:if]

This is my code in a delimeter field tab that I have set to display on the portrait tab. I tried it this way and by doing
Code:
[cb:if cb_rank="Recruit"] <img src="components/com_comprofiler/images/recruit.png" alt="alt" /> [/cb:if]
And that doesn't work either. Any help?

Please Log in or Create an account to join the conversation.

13 years 4 weeks ago #180737 by busterocaps
Replied by busterocaps on topic Re: CB if statement usage help
Hey everyone, just trying to get a little help with this. :whistle:

Please Log in or Create an account to join the conversation.

13 years 4 weeks ago - 13 years 4 weeks ago #180761 by pepperstreet
Replied by pepperstreet on topic Re: CB if statement usage help
Here is an example from another thread :

[cb:if cb_mycheckbox="1"]<img src="[cb:config param="live_site" /]/images/myicon.png" alt="Yes" />[/cb:if]


General help on "krileon's" page called "substitution-usage":
www.allmysocials.com/index.php?option=com_flexicontent&view=items&id=233:substitution-usage
Last edit: 13 years 4 weeks ago by pepperstreet.

Please Log in or Create an account to join the conversation.

13 years 3 weeks ago - 13 years 3 weeks ago #180797 by busterocaps
Replied by busterocaps on topic Re: CB if statement usage help
Thanks for responding, but
Code:
[cb:if cb_rank="Recruit"]<img src="[cb:config param="live_site" /]/images/recruit.png" alt="Recruit"/>[/cb:if] [cb:if cb_rank="Private"]<img src="[cb:config param="live_site" /]/mages/pvt.png" alt="Private"/>[/cb:if] [cb:if cb_rank="Corporal"]<img src="[cb:config param="live_site" /]/images/Cprl.png" alt="Corporal"/>[/cb:if] [cb:if cb_rank="Sergeant"]<img src="[cb:config param="live_site" /]/images/Sgt.png" alt="Sergeant"/>[/cb:if] [cb:if cb_rank="Master Sergeant"]<img src="[cb:config param="live_site" /]/images/Master Sgt.png" alt="Master Sergeant"/>[/cb:if] [cb:if cb_rank="Lieutenant"]<img src="[cb:config param="live_site" /]/images/LT.png" alt="Lieutenant"/>[/cb:if] [cb:if cb_rank="Captain"]<img src="[cb:config param="live_site" /]/images/captain.png" alt="Captain"/>[/cb:if] [cb:if cb_rank="Council"]<img src="[cb:config param="live_site" /]/images/council.png" alt="Council"/>[/cb:if]

Doesn't work either...:(
Odd thing, I've done this for something else, and it worked fine. I don't even get the alt text in the field.
Even odder still, checking with firebug reveals this:
Code:
<td class="titleCell"> <label id="cblabcbfv_89" for="cbfv_89">Rank Pic:</label> </td> <td id="cbfv_89" class="fieldCell"> </td>
Which seems to indicate CB is just ignoring the code there because the forum rank and pic show up with this code:
Code:
<td class="titleCell"> <label id="cblabcbfv_23" for="cbfv_23">Forum Ranking:</label> </td> <td id="cbfv_23" class="fieldCell"> Overlord <br> <img border="0" alt="Overlord" src="http://dogs-o-war.com/components/com_kunena/template/default/images/ranks/dow forum administrator medal custom.png"> </td>
and I would expect something similar here.
Last edit: 13 years 3 weeks ago by busterocaps.

Please Log in or Create an account to join the conversation.

13 years 3 weeks ago #180854 by pepperstreet
Replied by pepperstreet on topic Re: CB if statement usage help
Did you try a simple field output WITHOUT any IF conditions... just the field value! What happens than?
The following user(s) said Thank You: busterocaps

Please Log in or Create an account to join the conversation.

13 years 3 weeks ago #180950 by busterocaps
Replied by busterocaps on topic Re: CB if statement usage help
If I just put the image tag in in the field, as so:
Code:
<img src="images/recruit.png" alt="Recruit" />
the picture comes up fine

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum