Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-07-29 01:06:37

WhiteDog
Member
From: Maine
Registered: 2005-09-07
Posts: 174

Featured Section

Hi this should be a pretty simple answer, but I am trying to setup a featured section using

<txp:article_custom form=“featured” category=“featured” limit=“5” />

the form tag containing only <txp:body />

that works perfectly

the problem arises because i do not want the featured category to appear in my normal <txp:article limit=“5” /> tag
so I was hoping someone more savy than I could tell me how to exclude a category from the txp:article tag

thanks in advance!


Grrr RRR nnndth grrr Skeek!

Offline

#2 2007-07-29 10:23:49

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Featured Section

At the moment, this requires a plugin (have a look on textpattern.org), because there’s no way with the standard TXP tags to create a list of 5 articles while at the same time excluding articles belonging to a specific category. Only one of those requirements can be filled at the same time (either limit 5 or the category exclusion).

Offline

#3 2007-07-29 13:42:45

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

Re: Featured Section

WhiteDog wrote:

the problem arises because i do not want the featured category to appear in my normal <txp:article limit=“5” /> tag
so I was hoping someone more savy than I could tell me how to exclude a category from the txp:article tag

You can do this in your article form:

<txp:if_article_category name="featured">
<txp:else />
here your title and body tags etcetera
</txp:if_article_category>

Offline

#4 2007-07-29 14:04:48

WhiteDog
Member
From: Maine
Registered: 2005-09-07
Posts: 174

Re: Featured Section

ok so if i understand this

<txp:if_article_category name=“featured”>
(do nothing)
<txp:else />
<txp:title />
<txp:excerpt />
</txp:if_article_category>

would there be a way to limit the number of articles on the front page that way?


Grrr RRR nnndth grrr Skeek!

Offline

#5 2007-07-29 14:06:20

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

Re: Featured Section

Just use limit="5" in your article tag?

Offline

#6 2007-07-29 14:09:01

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

Re: Featured Section

Sorry, re-reading makes me think I misunderstood you. You just want to exclude 5 articles with category ‘featured’, right? Let me think about that.

Offline

#7 2007-07-29 14:26:15

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

Re: Featured Section

What about a plug-in such as chh_article_custom or mem_article_custom instead of the standard <txp:article /> tag? Would that work?


Stuart

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

Offline

#8 2007-07-29 15:56:46

WhiteDog
Member
From: Maine
Registered: 2005-09-07
Posts: 174

Re: Featured Section

thanks els and thebombsite but I think I am confusing what I am trying to do.

all i basically want is the exclude=“featured” which you can use in <txp:category_list /> except I need it in <txp:article />

the chh_article_custom may do what I want.


Grrr RRR nnndth grrr Skeek!

Offline

#9 2007-07-29 18:36:03

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

Re: Featured Section

Still not sure what you want to do exactly, but what if you create a form with my code above to use in attribute listform and use your regular form for attribute form in the article tag?

Offline

Board footer

Powered by FluxBB