Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » if_not_category

#1 2006-02-20 20:02:21

mazso
Member
Registered: 2005-09-29
Posts: 25

if_not_category

I want to show on the frontpages main column all articles from section “articles” – except those with the category “sidebar”. On the sidebar there should be displayed only the “articles” from category “sidebar”. This is an easy one:

<code><txp:article_custom section=“articles” category=“sidebar” /></code>

But what about the main column? Is there something like <code><txp:if_not_category name=“sidebar”></code>?

Thanks for your help

Mazso

Offline

#2 2006-02-20 20:09:35

Joey
Member
From: Netherlands
Registered: 2005-01-19
Posts: 257

Re: if_not_category

I don’t think that tag exist. I also don’t know if there is a plugin which can offset categories (I didn’t found something on google when I was searching for a little while). You problably need to use <txp:article_custom section="articles" category="all_cats_you_want" /> and specify all categories you want.


Regards,

Joey

Offline

#3 2006-02-20 20:40:31

mazso
Member
Registered: 2005-09-29
Posts: 25

Re: if_not_category

Okay, this would work. But what if the txp-user forget the category?

Mazso

Offline

#4 2006-02-20 20:43:53

Joey
Member
From: Netherlands
Registered: 2005-01-19
Posts: 257

Re: if_not_category

Hmm I don’t know if <txp:article_custom section="articles" category="all_cats_you_want" /> also includes the articles without a category:S


Regards,

Joey

Offline

#5 2006-02-20 20:44:46

alesh
Member
From: Miami, FL
Registered: 2005-04-13
Posts: 228
Website

Re: if_not_category

<txp:if_category name="sidebar"><else>  . . .  your content here . . . </txp:if_category>

Last edited by alesh (2006-02-20 20:45:02)


Yes, I have tried turning it off and on.

Offline

#6 2006-02-20 21:36:17

mazso
Member
Registered: 2005-09-29
Posts: 25

Re: if_not_category

> alesh wrote:

> bc.. <txp:if_category name=“sidebar”><else> . . . your content here . . . </txp:if_category>

Thank you, alesh. I tried this beforehand. But it didn’t work. It’s really strange. Because this works fine.

<code><txp:article_custom form=“default” category=“sidebar” /></code>

And this should display the same, right?

<code><txp:if_category name=“sidebar”>
<txp:article_custom form=“default” />
</txp:if_category></code>

Instead nothing will happen. The sidebar is empty. It´s my fault? Or maybe a bug in 4.03?

Okay, got it. I used <code> txp:if_article_category </code> in the article form. Like this:

<code><txp:if_article_category name=“sidebar”>
<txp:else />
<h1><txp:title /></h1>
<txp:body />
</txp:if_article_category></code>

Last edited by mazso (2006-02-20 21:53:52)

Offline

#7 2006-02-21 00:23:58

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: if_not_category

I added this to the FAQ.


Alex

Offline

#8 2006-02-22 15:20:33

Joey
Member
From: Netherlands
Registered: 2005-01-19
Posts: 257

Re: if_not_category

But can I offset a category from a article list with this (sorry I don’t understand some things)?


Regards,

Joey

Offline

  1. Index
  2. » Archives
  3. » if_not_category

Board footer

Powered by FluxBB