Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Showing/Hiding a div with if article list
Hi – I have the following code on one of my page templates:
<code><div id=“wrap”>
<div id=“nav”><txp:output_form form=“navigation” /></div>
<div id=“wrapinner”><img src=”/images/header/qiba-staff.png” alt=“About QIBA, Queensland International Business Academy, Gold Coast, Australia” width=“410” height=“162” style=“float: right;” /></div>
<div id=“nav2”>
<div id=“search”><txp:search_input wraptag=”“ label=“Search Site” /></div>
<txp:output_form form=“language” />
</div>
<div id=“content”>
<txp:article form=“about” section=“home” />
</div>
<div id=“right”>Images go here</div>
<div id=“footer”></div></code>
I would like to show/hide the div id=“right” depending upon whether it is the article list (show), or the actual article (hide). I tried using if article list on the page – but this didn’t work.
This was my code:<code><txp:if_article_list><div id=“right”>Images go here</div><txp:else /><br /></txp:if_article_list></code>
Offline
Re: Showing/Hiding a div with if article list
It should work- are you sure the section is using the correct template?
You could also leave off the else
, since you aren’t doing anything on the article page:
<pre>
<txp:if_article_list>
<div id=“right”>
Images go here
</div>
</txp:if_article_list>
</pre>
Offline
Re: Showing/Hiding a div with if article list
Ha ha – its a good job I can laugh at myself :)
The reason why it was working was because that section doesn’t have an article list (doh!!!)
jm – both your code and mine works fine on sections with article lists… I’m glad tis the weekend
Offline
Offline