Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2009-05-18 20:14:02
- Gulfcoast
- Member
- Registered: 2009-04-12
- Posts: 76
Article Limit
I’m using the following as part of my article default page:
<txp:if_category name=“business,grace,onetothree,fourtosix,offtopic”>
<txp:article />
<txp:else />
<txp:article_custom status=“sticky” id=“3”/>
<txp:article />
</txp:if_category>
I want to limit the number of articles the home page pulls. I’ve put limit=“whatever number” after <txp:article limit=“3” /> and tried other trial scenarios as well but I’m coming up empty handed. Is this not the area I need to be working on that? Thank you.
Offline
Re: Article Limit
The limit
attribute of <txp:article />
is indeed how you control this. So it’s a question of whether or not you’re editing the correct <txp:article />
tag — even in your short example there are two of them.
Code is topiary
Offline
#3 2009-05-18 20:41:13
- Gulfcoast
- Member
- Registered: 2009-04-12
- Posts: 76
Re: Article Limit
Thank you for your post J Soo. I’m curious…with the limit=“whatever number” in the first <txp:article limit=“3”> tag, is it limiting the “total” number of articles listed to 3 or 3 per “category”?
Offline
Re: Article Limit
Total number of articles returned.
Code is topiary
Offline
#5 2009-05-18 21:35:42
- Gulfcoast
- Member
- Registered: 2009-04-12
- Posts: 76
Re: Article Limit
I have confirmed it is the:
<txp:if_category name=“business,grace,onetothree,fourtosix,offtopic”>
<txp:article />
<txp:else />
<txp:article_custom status=“sticky” id=“3”/>
<txp:article />
</txp:if_category>
statement as I deleted it and just put: <txp: article limit=“3”> and it worked fine.
Any hint on what to look at next or …
Offline
Re: Article Limit
From your initial post I can’t figure out what problem you’re having — too many articles? not enough? Is the problem when you are showing a category list (i.e., a page with a URL such as /?c=“business” or /category/business, depending on your URL mode preference) or in the else
part of this code? Are you clear on the distinction between if_category
and if_article_category
?
Code is topiary
Offline
#7 2009-05-18 22:15:56
- Gulfcoast
- Member
- Registered: 2009-04-12
- Posts: 76
Re: Article Limit
Too many articles on the home page. I want to limit them. I’m looking into the differences between the two tags.
Offline
Re: Article Limit
Why do you have <txp:article_custom status=“sticky” id=“3”/>
and <txp:article />
?
If you want to display that 1 sticky article and 3 other articles you’d add the limit to <txp:article />
.
<txp:article limit="3" />
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
#9 2009-05-18 22:36:10
- Gulfcoast
- Member
- Registered: 2009-04-12
- Posts: 76
Re: Article Limit
Thank you Matt and J Soo. I see the error of my ways. It is like I was blind to the second <txp:article /> tag which J Soo had pointed out. Thank you again for taking the time to school me.
Offline
Pages: 1