Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2010-04-16 16:56:41
- Hugh_Griffith
- New Member
- Registered: 2010-04-16
- Posts: 2
Article limit being ignored
On this page – http://interactionhero.com/articles – I’m trying to list articles, but I want them to be styled differently depending on the article category. Everything seems to be working except it’s only spitting out 5 articles.
The page code:
<txp:if_individual_article>
<txp:article />
<txp:else />
<txp:article_custom section="articles" limit="99" form="articles" />
</txp:if_individual_article>
*The form "articles":*
<txp:if_article_category name="Design">
<div class="article_box">
<h2><txp:permlink><txp:title /></txp:permlink></h2>
<p class="datecom"><txp:posted format="%m.%d.%y" /> : <txp:comments_count /> comments</p>
<txp:body />
</div>
</txp:if_article_category>
<txp:if_article_category name="Newsworthy">
<div class="article_box">
<h2><txp:permlink><txp:title /></txp:permlink></h2>
<p class="datecom"><txp:posted format="%m.%d.%y" /> : <txp:comments_count /> comments</p>
<txp:body />
</div>
</txp:if_article_category>
<txp:if_article_category name="Personal">
<div class="article_box">
<h2><txp:permlink><txp:title /></txp:permlink></h2>
<p class="datecom"><txp:posted format="%m.%d.%y" /> : <txp:comments_count /> comments</p>
<txp:body />
</div>
</txp:if_article_category>
<txp:if_article_category name="Worthy_links">
<div class="article_box">
<h2><txp:permlink><txp:title /></txp:permlink></h2>
<p class="datecom"><txp:posted format="%m.%d.%y" />
<txp:body />
</div>
</txp:if_article_category>
<txp:if_article_category name="Great_quotes">
<div class="article_box">
<div class="talky">
<txp:body />
</div>
<div class="q_author">
<p><txp:custom_field name="q_author" /></p>
</div>
</div>
</txp:if_article_category>
(added bc..
for better code display. -Els)
Last edited by els (2010-04-16 17:33:49)
Offline
#2 2010-04-16 17:27:18
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,315
Re: Article limit being ignored
You’ve 9 more articles in your source code but they’re hidden/commented out. How many articles would you expect for section “articles”?
BTW You can merge the first three blocks of code by making use of a comma separated list for if_article_category’s name attribute
Last edited by uli (2010-04-16 17:36:48)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#3 2010-04-16 17:46:13
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Article limit being ignored
A couple of remarks:
Don’t use capitals in category (and section) names, it can cause unpredictable behaviour. This is not likely the cause of your problem, but you’d better change it, just in case.
Is it correct that only the last article category (great_quotes) is different? In that case your code can be much shorter:
<txp:if_article_category name="Great_quotes">
<div class="article_box">
<div class="talky">
<txp:body />
</div>
<div class="q_author">
<p><txp:custom_field name="q_author" /></p>
</div>
</div>
<txp:else />
<div class="article_box">
<h2><txp:permlink><txp:title /></txp:permlink></h2>
<p class="datecom"><txp:posted format="%m.%d.%y" /> : <txp:comments_count /> comments</p>
<txp:body />
</div>
</txp:if_article_category>
Are there more categories than those in your conditional tags? If that is the case it problably causes the problem, because the article_custom tag calls (and counts) articles of all categories, while only those specified in the if_article_category tags are displayed. If you only want to display the specified categories, you should add them to the article_custom tag: category="cat1,cat2,cat3,etc"
.
Offline
#4 2010-04-16 18:57:55
- Hugh_Griffith
- New Member
- Registered: 2010-04-16
- Posts: 2
Re: Article limit being ignored
I did miss one category and that was causing the problem. Thanks for the help!
Offline
Pages: 1