Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-06-09 22:54:56

Anna
New Member
From: Tübingen, Germany
Registered: 2010-06-09
Posts: 2
Website

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??

See the site for yourself.

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

#3 2010-06-09 23:13:23

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#4 2010-06-10 18:04:31

Anna
New Member
From: Tübingen, Germany
Registered: 2010-06-09
Posts: 2
Website

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

Board footer

Powered by FluxBB