Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2005-10-08 14:44:12
- grad
- Member
- From: Poznan, Poland
- Registered: 2005-10-04
- Posts: 24
...make TXP distinguish sticky articles w/ cat from articles w/o cat.?
How to filter sticky articles that don’t belong to any category and those that belong to any category within current section? I need something like this:
<code><!— Section’s summary —>
<txp:article form=“summary” limit=“1” status=“sticky” category=“empty” />
<!— Subsections’ summaries —>
<txp:article form=“summary-front-sub” status=“sticky” category=“not_empty” /></code>
Is there a standard way to do this or a plugin?
Help would be very appreciated.
Last edited by grad (2005-10-09 08:47:55)
Offline
#2 2005-10-10 14:44:43
- grad
- Member
- From: Poznan, Poland
- Registered: 2005-10-04
- Posts: 24
Re: ...make TXP distinguish sticky articles w/ cat from articles w/o cat.?
I haven’t found a way to do it. I wanted a sticky article without category to sit on top of stickies with categories. Filtering on existence of category would be the best option to rely on as <code>offset</code> takes into accout all articles of given status. I had to use status pending for this.
Offline
#3 2005-10-10 15:12:53
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: ...make TXP distinguish sticky articles w/ cat from articles w/o cat.?
The mdm_if_category plugin can do that. Example:
<code><txp:mdm_if_category category=”!”>
article tag for article without category here
</txp:mdm_if_category></code><br />
<code><txp:mdm_if_category category=”“>
article tag for article with category here
</txp:mdm_if_category></code><br />
I’m not using it anymore so I’m not absolutely sure that this plugin still works in 4.0.1.
Offline
#4 2005-10-11 09:07:25
- grad
- Member
- From: Poznan, Poland
- Registered: 2005-10-04
- Posts: 24
Re: ...make TXP distinguish sticky articles w/ cat from articles w/o cat.?
doggiez, thanks. I’ve tried it but it’s not what I meant. mdm_if_category filters current category only, basically it works the same as updated if_category. What I want is to display on the same page (which is not category list) sticky articles with and without categories. It is on the section’s frontpage:
[section’s frontpage]- sticky article without any category (always on top)
- sticky article with category-1
- sticky article with category-2
- …
- sticky article with category-n
Offline
#5 2005-10-11 13:13:20
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: ...make TXP distinguish sticky articles w/ cat from articles w/o cat.?
Ah, I see. Then I don’t think it’s possible, what you would need is a value for ‘category’ like “” or “!”, but that doesn’t exist (yet?). What you could do as a workaround is create a category called ‘empty’…
Offline
#6 2005-10-11 13:25:04
- grad
- Member
- From: Poznan, Poland
- Registered: 2005-10-04
- Posts: 24
Re: ...make TXP distinguish sticky articles w/ cat from articles w/o cat.?
(…) what you would need is a value for ‘category’ like “” or “!”, but that doesn’t exist (yet?).
Exactly.
What you could do as a workaround is create a category called ‘empty’…
I can’t use a dummy category, as it would appear on my category list which is to mimic subsections.
Offline
#7 2005-10-11 13:58:41
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: ...make TXP distinguish sticky articles w/ cat from articles w/o cat.?
grad wrote:
I can’t use a dummy category, as it would appear on my category list which is to mimic subsections.
What about something like this plugin for your category list then? Make your dummy category a subcategory and it’s excluded from the list.
Offline
#8 2005-10-12 18:45:47
- grad
- Member
- From: Poznan, Poland
- Registered: 2005-10-04
- Posts: 24
Re: ...make TXP distinguish sticky articles w/ cat from articles w/o cat.?
Thanks.
Offline