Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-05-22 07:12:12
- passivepilgrim
- New Member
- Registered: 2006-05-22
- Posts: 4
Category not displaying articles...
… except a sticky if there is that one for that category.
If I link to www.mysite/category/nameOfCategory shouldn’t a bunch of articles from nameOfCategory appear? Not just a sticky if there is one for nameOfCategory?
For troubleshooting I’ve tried to put the default page template back to normal, so all the <txp:article /> stuff should be like installed… but when I put textpattern into debug mode I get:
“tag_error <txp:older> -> Notice: Undefined variable: numPages on line 664
tag_error <txp:newer> -> Notice: Undefined variable: numPages on line 622”
Anybody out there who knows what my problem is? Pretty please.
(I did use a <txp:category_list /> to make sure the categories were appearing).
Thank you for any help!
Sid
Offline
#2 2006-05-22 21:47:18
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Category not displaying articles...
You need to put an article tag on your default page. It sounds like you’ve only got one article tag there, and it’s to call a sticky. So what you want would be:
<txp:if_category>
<txp:article form="your_category_display_form" />
<txp:else />
<txp:article status="sticky" form="your_frontpage_form" />
</txp:if_category>
:)
Offline
#3 2006-05-23 00:44:11
- passivepilgrim
- New Member
- Registered: 2006-05-22
- Posts: 4
Re: Category not displaying articles...
I was trying to use the basic default page that comes with the install. There’s headers and footer’s, but the meat of it is still same:
<code>
<txp:category_list break=”<br>” />
<txp:if_category>
<txp:article />
<txp:else />
<txp:article status=“sticky” />
</txp:if_category>
<div id=“content”>
<txp:article />
<txp:if_individual_article>
<p>
<txp:link_to_prev><txp:prev_title /></txp:link_to_prev>
<txp:link_to_next><txp:next_title /></txp:link_to_next>
</p>
</txp:if_individual_article>
<txp:if_article_list>
<p>
<txp:older>Previous</txp:older>
<txp:newer>Next</txp:newer>
</p>
</txp:if_article_list>
</div>
</code>
And I tried adding your code Mary, but still just the stickies are coming up under the category…. but, I haven’t made category display form.
(I don’t know if a link to the site helps my cause at all, but http://www.leeskitchen.com.au/All-Recipes – ‘Mains’ has a Sticky, but ‘Soups’ do not :))
Offline
#4 2006-05-23 00:54:25
- passivepilgrim
- New Member
- Registered: 2006-05-22
- Posts: 4
Re: Category not displaying articles...
Tag trace!
From a category page… does “[SQL (0.000125): select name from `txp_category` where `name` like ‘recipes-8211-mains’ limit 1]” where it says ‘limit 1’ mean it’s only getting the first article?
<code>
<!-- Runtime: 0.0141 -->
<!-- Query time: 0.004519 -->
<!-- Queries: 16 -->
<!-- Memory: no info available -->
<!-- txp tag trace:
[SQL (0.000153): select name from `txp_lang` where lang='en-gb' limit 1]
[SQL (0.001100): select name, data from `txp_lang` where lang='en-gb' AND ( event='public' OR event='common')]
[SQL (0.000101): select name, code from `txp_plugin` where status='1']
[SQL (0.000125): select name from `txp_category` where `name` like 'recipes-8211-mains' limit 1]
[SQL (0.000125): select * from `txp_section` where name = 'default' limit 1]
[SQL (0.000401): insert into `txp_log` set `time`=now(),page='/category/Recipes-8211-Mains/',ip='202.173.188.40',host='202.173.188.40',refer='',status='200',method='GET']
[SQL (0.000115): select user_html from `txp_page` where name='static_page']
[Page: static_page]
<txp:css/>
<txp:page_title/>
[SQL (0.000118): select title from `txp_category` where name='recipes-8211-mains' and type='article']
<txp:output_form form="header_preload" />
[SQL (0.000111): select form from `txp_form` where `name` = 'header_preload' limit 1]
<txp:output_form form="headerNav" />
[SQL (0.000109): select form from `txp_form` where `name` = 'headerNav' limit 1]
<txp:link_to_home>
</txp:link_to_home>
<txp:link_to_home/>
<txp:article limit=1 form="static_article" status="sticky" />
[SQL (0.000128): select name from `txp_section` where on_frontpage != '1']
[SQL (0.000848): select *, unix_timestamp(Posted) as uPosted from `textpattern` where 1 and Status='5' and Posted < now() and ((Category1='recipes-8211-mains') or (Category2='recipes-8211-mains')) and Section != 'contact' order by Posted desc limit 0, 1]
[SQL (0.000111): select Form from `txp_form` where `name` = 'static_article' limit 1]
[Form: static_article]
[article 16]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:body/>
<txp:comments_invite wraptag="p" />
<txp:if_individual_article>
[<txp:if_individual_article>: false]
</txp:if_individual_article>
<txp:if_article_list>
[<txp:if_article_list>: true]
<txp:older>
</txp:older>
<txp:newer>
</txp:newer>
</txp:if_article_list>
<txp:output_form form="Footer" />
[SQL (0.000208): select form from `txp_form` where `name` = 'Footer' limit 1]
<txp:search_input label="Search the Site:" />
[SQL (0.000107): select form from `txp_form` where `name` = 'search_input' limit 1]
[ --- secondpass --- ]
-->
</code>
Offline
#5 2006-05-23 01:48:02
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Category not displaying articles...
Okay, your categories have stickies, which you want, so yes, what you’d want is just the two calls to the article tag, without the conditional:
<txp:category_list break="br" />
<div id="content">
<txp:article status="sticky" />
<txp:article />
…‘limit 1’ mean it’s only getting the first article?
No, that query is fetching the category, to see if it actually exists.
But, your tag trace tells me that your “section” in question is not using the “page” you think it is.
Offline
#6 2006-05-23 03:58:41
- passivepilgrim
- New Member
- Registered: 2006-05-22
- Posts: 4
Re: Category not displaying articles...
Don’t I feel like an idiot. Been fiddling around with the sections on and off for a week now, but keep scrolling past ‘Default’ – which was, of course, set wrong.
Thanks heaps!
Offline
Pages: 1