Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-06-24 10:46:19

philbowell
Member
Registered: 2009-06-05
Posts: 12

If Statement Not Displaying Anything

I’m in the process of building my first TXP based site. It’s the website for the design studio I work for, so we have a blend of static pages and a Portfolio page. The static pages I have working and displaying correctly, however I’m struggling with the portfolio section.

I have my portfolio page which is to display 3 (at the moment) pieces of work, using the excerpt to display thumbnail images. Then clicking a link below one of the images is to take you to the project page. As I understand it I have to use an IF statement to do this as I can’t assign two different pages to an article.

(Hope I’ve not lost you with that.)

The IF statement I am using is this:

<div class="portfolio">
	<txp:if_individual_article>
		<txp:article form="portfolio" />
	<txp:else />
		<div class="designers">
			<h3 class="dtitle">The Designers</h3>
			<p>text here</p>
		</div>
		<div class="printers">
			<h3 class="ptitle">The Printers</h3>
			<p>text here</p>
		</div>
		<txp:article form="article_listing" limit="3" />
	</txp:if_individual_article_listing">
</div>

However nothing is displayed. It’s just blank with only code that comes before the IF outputting anything. Can anyone help me please?

Also, apologies for the lack of breaks in the code. I’ new to Textile too and I can’t seem to make it display as anything but a long string.

added bc. and formated the oneliner code more readable – Gocom

Last edited by Gocom (2009-06-24 11:09:22)

Offline

#2 2009-06-24 11:09:00

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: If Statement Not Displaying Anything

Take a look at this:

</txp:if_individual_article_listing">

Should be:

</txp:if_individual_article">

Offline

#3 2009-06-24 11:10:29

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: If Statement Not Displaying Anything

jstubbs wrote:

</txp:if_individual_article">

Hehe, minus the ", so </txp:if_individual_article>

Offline

#4 2009-06-24 11:18:47

philbowell
Member
Registered: 2009-06-05
Posts: 12

Re: If Statement Not Displaying Anything

Thanks guys! All working now :-)

@Gocom, thanks for fixing my code posting as well.

Offline

Board footer

Powered by FluxBB