Content last modified Monday 5 September 2016
hop to #bottom
Categories:
About It:
Rate it:
  • Helpful?
  • 2 Yes
  • 3 No
Flag it:
Contact Reason [ ? ]

article vs. article_custom

<txp:article /> is NOT the same as <txp:article_custom />

They cannot be interchanged. This is perhaps one of the most common confusions for Textpatterners.

<txp:article_custom /> offers many additional attributes that <txp:article /> does not.. but only <txp:article /> will produce the full single article page.. if you have only <txp:article_custom /> on a page, rather than <txp:article />, then you will never reach the permalinked article page—you’ll always get an article list page.

however, you can have the added features and functionality of <txp:article_custom />, while keeping the necessary <txp:article /> in full force by using conditionals:

<txp:if_individual_article> and <txp:if_article_list>

i like to think of it as having your cake and eating it too.

e.g.
<txp:if_article_list>
<txp:article_custom form="lofi" limit="10" category="ideas" section="article" sortby="Posted" sortdir="desc" />
</txp:if_article_list>


<txp:if_individual_article>
<txp:article />
</txp:if_individual_article>

detailed tag information:

<txp:article />
<txp:article_custom />

Article Request Count:
Posted here:
10 Apr 2005
Article modified:
10 Apr 2005

Comments/questions? Leave a message in the form.

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Commented (5)

This tuto is a must read for beginners, nice work ! Could also fit with some rewrite on textpattern.net :)
i think this should definitely be at TextBook.. but does it go under some sort of general category under ‘Tags’, or under ‘Semantics’ or ‘Frequently Asked Questions’...?
I think, this tutorial is most important for beginners and all comunity textpattern :)
Ian:
Is there a way to make it list only the articles that are in the same section as the current article ? – I know I can do this by manually entering the section name, but I have several sections and want to use the same page presentation for each.

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

Would you care to write a comment?

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.