I have an IF condition then insertfile plus a php condition that it is only produced on first page. It doesn't like both the IF and php and duplicates some of the content. Tried changing the IF to php but it hated that even more!
Here is what I have...
<IF {CATBREEDSTANDARD}> <p>Looking for a {CATNAME} puppy, dog or advice? Contact one of the {CATNAME} breeders or breed clubs listed below. All dog breeders advertising with us agree to abide by our Code of Ethics. </p> <h2>{CATNAME} Books</h2> <script src="<?php global $page, $templatesdir; if ($page == 1) { echo fileread("$templatesdir/custom/breedprofile.tpl"); } ?>
Paul wrote: I'm not sure if you can nest an INSERTFILE like that. Try <?php global $page, $templatesdir; if ($page == 1) { echo fileread("$templatesdir/custom/breedprofile.tpl"); } ?>
That didn't work at all and made it a lot worse, just showing the {FIELDS} instead of the info.
In playing around I found that the problem wasn't in fact the php but the IF statement with the insertfile that is causing the problem. Take out the php leaving the IF condition and it still duplicates some content. Take out the IF and leave the php and it shows fine.
0/5
1
2
3
4
5
This thread is closed, so you cannot post a reply.
Comments on IF condition and php condition
Expert
Usergroup: Customer
Joined: Aug 19, 2005
Location: England
Total Topics: 391
Total Comments: 1303
I have an IF condition then insertfile plus a php condition that it is only produced on first page. It doesn't like both the IF and php and duplicates some of the content. Tried changing the IF to php but it hated that even more!
Here is what I have...
Expert
Usergroup: Customer
Joined: Aug 19, 2005
Location: England
Total Topics: 391
Total Comments: 1303
I'm not sure if you can nest an INSERTFILE like that. Try
<?php global $page, $templatesdir; if ($page == 1) { echo fileread("$templatesdir/custom/breedprofile.tpl"); } ?>
That didn't work at all and made it a lot worse, just showing the {FIELDS} instead of the info.
In playing around I found that the problem wasn't in fact the php but the IF statement with the insertfile that is causing the problem. Take out the php leaving the IF condition and it still duplicates some content. Take out the IF and leave the php and it shows fine.