Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
[SOLVED] Multiple if_section tags
Hey guys, on my main page of my site I have an image that I wish to change depending ont he section, I understand I can do this via:
<txp:if_section name="glaciercraft">
<img src="http://resources.glaciergaming.co.uk/images/main_panels/glacier_craft_panel.jpg" />
</txp:if_section>
What I need is to be able to have a certain image appear only when a certain section is selected, but if one of the defined sections is not , then show a default image. So say I selected the section called PS3, it would just show the main image, or if no sections were selected at all, so say the home page, it would also show the main panel. So the 3 I would need is:
<txp:if_section name="glaciercraft">
<img src="http://resources.glaciergaming.co.uk/images/main_panels/glacier_craft_panel.jpg" />
</txp:if_section>
<txp:if_section name="eurogamer">
<img src="http://resources.glaciergaming.co.uk/images/main_panels/eurogamer_panel.jpg" />
</txp:if_section>
<txp:if_section name="EVERY THING ELSE">
<img src="http://resources.glaciergaming.co.uk/images/main_panels/main_panel.jpg" />
</txp:if_section>
Any help would be greatly appreciated, it’s been driving me mad! Thanks in advance!
Last edited by SPKuja (2013-09-06 22:29:20)
Offline
Re: [SOLVED] Multiple if_section tags
Would this work?
php <txp:if_section name="glaciercraft">
<img src="http://resources.glaciergaming.co.uk/images/main_panels/glacier_craft_panel.jpg" />
<txp:else/>
<txp:if_section name="eurogamer">
<img src="http://resources.glaciergaming.co.uk/images/main_panels/eurogamer_panel.jpg" />
<txp:else/>
<img src="http://resources.glaciergaming.co.uk/images/main_panels/main_panel.jpg" />
</txp:if_section>
</txp:if_section>
Last edited by MattD (2014-01-10 19:06:01)
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: [SOLVED] Multiple if_section tags
That worked perfectly, thank you!
Offline
Pages: 1