Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2009-11-19 11:28:17
- sams101
- Member
- Registered: 2009-11-09
- Posts: 23
Article limit
Hi there,
I currently am very close to finishing the functionality on my site. I have a few little problems I’m trying to iron out. One of which, i can’t seem to see the logic behind.
I have a list of articles that are being displayed by
<txp:article listform="ss_default" limit="4" />
This calls my default form in, which seems to be displaying the list of articles properly, but the limit is wrong. If i have a limit of 4, as above, it displays only the latest 3. If i change the limit to 5 it still displays only 3. Now if I change the limit to 6, It displays 4.
Something I am missing here, but really unsure what. Here is my ss_default form if anyone has any ideas?
<txp:if_article_category name="portfolio">
<div class="featuredpost">
<div class="imagecontainer">
<txp:permlink><txp:upm_article_image type="thumbnail"/></txp:permlink> </div>
<div class="righttext"><txp:permlink>
<h2><txp:title /></h2><span class="ptext"><txp:excerpt /></span>
</txp:permlink>
</div>
</div>
</txp:if_article_category>
note: all the articles i’m trying to displayed are tagged with ‘portfolio’
Sam
Offline
Re: Article limit
sams101 wrote:
Something I am missing here, but really unsure what. Here is my ss_default form if anyone has any ideas?
Seems intended behaviour. Your code fetches first 4 rows, no matter what the category is, and after that filters articles out those four. Therefor, in some cases you will end up with less articles.
If you want to limit articles in specific category, it’s better to include the filtering in the query itself, or bad alternative is to sort the rows by categories, leading in successful after limit and filter.
With non-context sensitive article_custom:
<txp:article_custom category="portfolio" limit="4" />
PS. Note that your code generates invalid (X)HTML (block elements inside inline element).
Offline
#3 2009-11-19 12:18:11
- sams101
- Member
- Registered: 2009-11-09
- Posts: 23
Re: Article limit
Quality, yep have swapped the category query into the page rather than the form, all good now! Thanks for that.
As for the invalid html, I had to do this due to the nature of the design of my site (http://hellosam.co.uk/portfolio/) that is the non textpattern version. Under the html 5 doctype it is acceptable and validates.
Thanks for taking the time to look at this Jukka, very thankful
Offline
Pages: 1