Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-10-12 02:23:17

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

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

#2 2006-10-12 03:55:15

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

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>
&lt;txp:if_article_list&gt; &lt;div id=“right”&gt; Images go here &lt;/div&gt;
&lt;/txp:if_article_list&gt;
</pre>

Offline

#3 2006-10-13 07:18:43

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

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

#4 2006-10-13 20:44:25

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Showing/Hiding a div with if article list

Me too! Glad it’s working!

Offline

Board footer

Powered by FluxBB