Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2005-11-30 04:45:13

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Existing tags with improved functionality

Els – you may be able to use <code><txp:category /></code> in the head on it’s own to query if you are in a category list but I’ve tried using it with the “title=1” attribute inside the “title” tags and get no output.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#17 2005-11-30 07:51:15

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Existing tags with improved functionality

I do. Honestly. Rev 1090.

Edit: title=“y”

Last edited by doggiez (2005-11-30 07:53:00)

Offline

#18 2005-11-30 13:18:48

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Existing tags with improved functionality

I’ll try it again then. I’m on r1121 at the moment. I don’t think it matters what you use for the integer as long as it’s something. I always use “1”. I think it’s supposed to be an integer but it doesn’t seem to matter.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#19 2005-11-30 15:19:47

oldi
Member
Registered: 2005-10-14
Posts: 87

Re: Existing tags with improved functionality

Thanks, for your explanation. I have been looking at your latest template to learn something. But i have a question.

At the moment i am showing on the frontpage only 1 sticky article and a list of articles from one category. This is the code for it (you helped me on this)

<code><txp:glx_if_category_list>
<txp:article limit=“10” />
</txp:glx_if_category_list>

<txp:glx_if_frontpage>
<txp:article_custom section=“about” form=“Single” status=“sticky” limit=1 />
<txp:article_custom category=“news” limit=“5” />
</txp:glx_if_frontpage></code>

After reading this post i tried to use

<code><txp:if_category>
<txp:article limit=“10” />
</txp:if_category>

<txp:if_section name=”“>
<txp:article_custom section=“about” form=“Single” status=“sticky” limit=1 />
<txp:article_custom category=“news” limit=“5” />
</txp:if_section></code>

the problem is that now, the sticky article together with that one category appear everytime i want to list articles from other categories. This didn’t happen when using glx_if.

Am i doing something wrong?

thanks

Offline

#20 2005-11-30 18:03:43

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Existing tags with improved functionality

Try not using the “if_section” tag here. Try something like:-

<code>
<txp:if_category>
blah blah
<txp:else />
blah blah
</txp:if_category></code>
<br />

Also I don’t know what version you are using but 4.0.2 might help. I can never remember exactly when these improvements came in.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#21 2005-11-30 22:50:44

oldi
Member
Registered: 2005-10-14
Posts: 87

Re: Existing tags with improved functionality

thanks, it worked

Offline

#22 2005-12-01 12:33:02

oldi
Member
Registered: 2005-10-14
Posts: 87

Re: Existing tags with improved functionality

Sorry for coming back to ask some more questions. Could you please expand a bit on the search else tag.
In order to get what i mentioned above, I followed your example

<code><txp:if_category>
blah blah
<txp:else />
blah blah
</txp:if_category></code>

and it worked perfectly. But now, if i want to use the default page for search results, i still get the same problem where the sticky article and one category appears. Have tried different options with search else tag, but no success. Is it possible to do that, or do i have to use a seperate page for results.

thanks

Offline

#23 2005-12-01 15:39:55

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Existing tags with improved functionality

Ooo. Now that calls for some “nesting”. Try this:-

<code><txp:if_search>
blah blah
<txp:else />
<txp:if_category>
blah blah
<txp:else />
blah blah
</txp:if_category>
</txp:if_search></code>
<br />

That should work in theory. Of course you could send your search to it’s own page and avoid this. You could also review my little trick here to keep your category listing on the same page that the articles use. With those out of the way you would have a nice clean default page. :)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB