Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-12-07 06:53:41

Nichod
Member
Registered: 2005-06-06
Posts: 119

txp:else is this possible?

In this example. If an excerpt isn’t available it displays the section name.

<code><txp:if_excerpt>
And Furthermore · <txp:excerpt />
<txp:else />
<txp:section link=“y” />
</txp:if_excerpt>
</code>

<br><br>
Is it then possible to go farther with txp:else. For instance, is there a way that if an image isn’t define in an article then an image for the articles catergory is then displayed?

Offline

#2 2005-12-07 08:05:13

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: txp:else is this possible?

If you had a conditional tag to do that, yes. There’s no real limit to nesting tags. Just keep it sane (don’t do many levels deep). The only thing you can’t do (as in, it won’t work) is nest the same conditional tag inside it self (i.e: no “if_section” within an “if_section”, and so on).

I commonly use stuff like:

<txp:if_individual_article>

	an individual article page

<txp:else />

		<txp:if_category>

			a category page

		<txp:else />

			a list, but not a category page

		</txp:if_category>

</txp:if_individual_article>

Offline

#3 2005-12-07 10:12:44

Nichod
Member
Registered: 2005-06-06
Posts: 119

Re: txp:else is this possible?

With this in mind. Can the <code><txp:thumbnail /></code> be utilized in a form (article), in such a way that the thumbnail for the selected (advanced options) image is displayed per article? Or perhaps a way of nesting the “if” statements that in such a way that if an image is selected then load thumbnail here?

Offline

#4 2005-12-07 11:00:36

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: txp:else is this possible?

No. The thumbnail tag isn’t for article images. There is only one built-in tag that will handle those, article_image, and it will only show the full-size image. You’ll need a plugin for that, there are a few:

There may be more, but those are the ones I know of.

Last edited by Mary (2005-12-07 11:00:56)

Offline

Board footer

Powered by FluxBB