countrygyrl Posted June 25, 2010 Share Posted June 25, 2010 I tried asking this question in the joomla forums but noone had the answer for me. I am using a joomla extension called form2content and the template files must have the extension .tpl I am trying to put an if statement in there to only show certain things at certain times but I can't seem to get it to work properly. I have done tons of research on this and can not find the answer so I was hoping someone might have enough experience with .tpl files to help me out here. Any help would be greatly appreciated. I have tried many things nothing has worked but here is my code right now: <mos:tmpl name="root"> <!--[iF (HORSESIRE != "")]--> <p><strong>{HORSENAME}'s Pedigree Information:</strong></p> <table cellpadding="0" cellspacing="1" width="75%"> <tr> <td rowspan="4" class="maternal">{JOOMLA_TITLE}</td> <td rowspan="2" class="maternal">{HORSESIRE}</td> <td class="maternal">{HORSEGRANDSIRESIRE}</td> </tr> <tr> <td class="paternal">{HORSEGRANDDAMSIRE}</td> </tr> <tr> <td rowspan="2" class="paternal">{HORSEDAM}</td> <td class="maternal">{HORSEGRANDSIREDAM}</td> </tr> <tr> <td class="paternal">{HORSEGRANDDAMDAM}</td> </tr> </table> <!--[ELSE IF (HORSEPHOTO1 != "")]--> <p><strong>Photos of {HORSENAME}</strong></p> <p>Click on any of the images below to view a larger image. When you are done, simply click close to return to this page</p> <table class="pics"> <tr> <td>{HORSEPHOTO1}</td> <td>{HORSEPHOTO2}</td> <td>{HORSEPHOTO3}</td> <td>{HORSEPHOTO4}</td> <td>{HORSEPHOTO5}</td> <td>{HORSEPHOTO6}</td> </tr> </table> <!--[ELSE IF (FOAL4SALE1PIC != "")]--> <p><strong>{HORSENAME} has the following foals which are for sale:</strong></p> <table class="pics"> <tr> <td align="center">{FOAL4SALE1PIC}</td> <td align="center">{FOAL4SALE2PIC}</td> <td align="center">{FOAL4SALE3PIC}</td> <td align="center">{FOAL4SALE4PIC}</td> <td align="center">{FOAL4SALE5PIC}</td> <td align="center">{FOAL4SALE6PIC}</td> </tr> <tr> <td class="caption">{FOAL4SALE1}</td> <td class="caption">{FOAL4SALE2}</td> <td class="caption">{FOAL4SALE3}</td> <td class="caption">{FOAL4SALE4}</td> <td class="caption">{FOAL4SALE5}</td> <td class="caption">{FOAL4SALE6}</td> </tr> <tr> <td align="center">{FOAL4SALE7PIC}</td> <td align="center">{FOAL4SALE8PIC}</td> <td align="center">{FOAL4SALE9PIC}</td> <td align="center">{FOAL4SALE10PIC}</td> <td align="center">{FOAL4SALE11PIC}</td> <td align="center">{FOAL4SALE12PIC}</td> </tr> <tr> <td class="caption">{FOAL4SALE7}</td> <td class="caption">{FOAL4SALE8}</td> <td class="caption">{FOAL4SALE9}</td> <td class="caption">{FOAL4SALE10}</td> <td class="caption">{FOAL4SALE11}</td> <td class="caption">{FOAL4SALE12}</td> </tr> </table> <!--[endif]--> </mos:tmpl> Quote Link to comment https://forums.phpfreaks.com/topic/205823-if-statements-in-joomla-tpl-file/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.