Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
SQL query for <txp:article /> excludes all sections. Why?
Hello folks,
well, this is my first go at Textpattern but so far I like it a lot. However, I can’t seem to figure this one out. I get a mostly blank page when clicking any category link. This calls my default template, which simply doesn’t return any articles. Debugging mode tells me that the SQL query for the articles contains this bit: “ … where […] Section != ‘referenzen’ and Section != ‘angebot’ and Section != ‘preise-kosten’ and Section != ‘impressum’ and Section != ‘kontakt’”. Naturally this can’t work because it means that all my Sections are being excluded. But why does it do this??
Many thanks for your help!
Anna~
Offline
#2 2010-06-09 23:09:09
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: SQL query for <txp:article /> excludes all sections. Why?
Category pages use the default (front) page by default. If you set your sections to be displayed on the front page (Presentation > Sections), they will show up.
Offline
Re: SQL query for <txp:article /> excludes all sections. Why?
Hi Anna,
welcome to TXP community!
I’m not good when it comes to interpret the tag trace, but let’s see:
http://www.netzhexe.de/dev/txp/ <= this is your TXP website homepage (aka “default” section), right?
If so, for articles to appear there, you have to set the “On frontpage?” option in to “Yes” (on “Presentation -> Sections”), for each section that you would like to have its articles listed on front page.
Also, it seems that your <txp:article limit="5" />
is currently wrapped by if_category
tags, so it will only be rendered if you are looking at a category listing. But the URL (http://www.netzhexe.de/dev/txp/) is not a category listing, but your frontpage (again, aka “default” section).
You may want to try:
- http://www.netzhexe.de/dev/txp/category/somecategoryname, to test if it outputs any article belonging to
somecategoryname
- paste the
<txp:article limit="5" />
somewhere else (preferentially, outside any conditional tag) on your default page template, to test if it’s returning anything at all.
Let’s see if those tests change anything in the output and maybe you can find out what’s going on.
Offline
Re: SQL query for <txp:article /> excludes all sections. Why?
Els,
thank you ever so much, that did it! I meant to make my front page static, so I didn’t think to place any articles there. Of course, if “front page” means “default page”, it’s quite logical.
maniqui,
thank you too for your answer – the problem only existed when the if_category
statement was true, so that was quite correct. Els’s solution was exactly right.
:-) Anna~
Offline