Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-01-31 23:11:09
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
if section funny business
With a url of www.mysite.com/?c=housing filtered by the snippet below I expected the article which is only in category housing to be displayed, but it isn’t.
To me the logic says if this isn’t the default section then display the article in category housing.
Any thoughts?
<code>
<txp:if_section name=”“>
<txp:article status=“sticky” />
<txp:else />
<txp:article />
</txp:if_section>
</code>
—————
Edit: I got round it with
<code>
<txp:if_section name=”“>
<txp:article status=“sticky” />
</txp:if_section>
<txp:if_category>
<txp:article />
</txp:if_category>
</code>
But I still think the first snippet should have worked.
Last edited by lee (2006-01-31 23:25:16)
Offline
Re: if section funny business
Well your initial code would have a problem Lee. What it is saying is “if we are in “default” show the “sticky”, if we are NOT, show the latest “non-sticky” articles from any section/category that is allowed on the front-page.
Your second snippet says “if we are in “default” show the “sticky” ANDOR if we are in a category, show the latest articles from that category.
Last edited by thebombsite (2006-02-01 07:52:41)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#3 2006-02-01 08:36:17
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: if section funny business
Hi Stuart,
I thought (as do you) my first snipper said “if we are in “default” show the “sticky”, if we are NOT, show the latest “non-sticky” articles from any section/category that is allowed on the front-page.
But the problem is it isn’t showing articles that are only in a category (in my case category housing).
Offline
Re: if section funny business
Because you are in a category_list not a section. If you look at the URL when viewing an article in a category, there is no mention of a section (unless you’ve used my little bit of tag magic in the Tag forum). Your second piece of code includes the “if_category” conditional so now it will pick it up.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Pages: 1