Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-09-21 04:48:17
- rabbitofdeath
- New Member
- Registered: 2006-09-21
- Posts: 2
Categories and sections
hi all, I’m new to this but I’m loving it. I have Textpattern up and running on my site network0.org and am having an issue that I believe is a presentation issue.
I have my default section called blog and I can post to it and categorize it correctly. I also have another section called notebook, where i plan on writing documentation and other things but I not want it to show on the main page. I have found the option to turn off the main page display for notebook, but if I turn it off, the categories no longer work (I click the category and it returns an empty result for the category). I think i need to change default page to use an if_article_section=notebook then don’t display, but i’m really not sure where to start. Any help would be appreciated. Thanks!
Offline
#2 2006-09-21 22:18:31
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Categories and sections
Your solution would give you the same result. It’s because category lists use the default section and page by default. So if you say ‘don’t display section notebook on the front page’, neither will the category lists display articles from section notebook.
There are several solutions. You could use this on your page:
<txp:if_category name="cat1">
<txp:article_custom category="cat1" />
</txp:if_category>
(repeat this for every category)
<txp:if_category>
<txp:else />
<txp:article /> (your article tag for the front page)
</txp:if_category
Or you can make the category lists use their own section page, see instructions here.
Offline
#3 2006-09-21 23:23:58
- rabbitofdeath
- New Member
- Registered: 2006-09-21
- Posts: 2
Re: Categories and sections
Thanks for your reply, I decided to use Sections as Categories instead and that is working perfectly for me.
Offline
#4 2006-09-29 15:50:55
- krantix
- New Member
- Registered: 2006-09-29
- Posts: 7
Re: Categories and sections
Els i have almost the same problem… i would like the category “English” to show up all articles from different sections (even if these sections don’t have “show on first page” enabled”) that have been categorized as “English”…
any way to do that?
Last edited by krantix (2006-09-29 16:04:39)
Offline
#5 2006-09-29 20:42:20
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Categories and sections
krantix wrote:
any way to do that?
Yes :)
<txp:if_category name="English">
<txp:article_custom category="English" />
<txp:else />
<txp:article />
</txp:if_category>
Offline
#6 2006-09-29 22:20:52
- krantix
- New Member
- Registered: 2006-09-29
- Posts: 7
Re: Categories and sections
thanks a lot! it works…
isn’t there any better way to manage categories? every time i add one i will have to modify the default template?
Offline
#7 2006-09-29 22:29:02
- krantix
- New Member
- Registered: 2006-09-29
- Posts: 7
Re: Categories and sections
i cannot get things like this to work…
<txp:category_list label=“La libreria” parent=“Libreria” wraptag=“p” break=“br” />
they simply return a blank page if articles are not in a section with “show in first page”…
Offline
#8 2006-09-30 00:06:25
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Categories and sections
krantix wrote:
i cannot get things like this to work…
<txp:category_list label="La libreria" parent="Libreria" wraptag="p" break="br" />
they simply return a blank page if articles are not in a section with “show in first page”…
If you need this for more categories than ‘English’, you’ll have to add them to the code:
<txp:if_category name="English">
<txp:article_custom category="English" />
</txp:if_category>
<txp:if_category name="Libreria">
<txp:article_custom category="Libreria" />
</txp:if_category>
... and so on for every category...
<txp:if_category>
<txp:else />
<txp:article />
</txp:if_category>
Offline
#9 2006-10-08 14:31:26
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,304
Re: Categories and sections
<txp:if_category>
<txp:else />
<txp:article /> (your article tag for the front page)
</txp:if_category
sorry guys, what is article tag, the article url?
Offline
#10 2006-10-08 14:55:54
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Categories and sections
Gallex wrote:
<code><txp:if_category>
<txp:else />
<txp:article /> (your article tag for the front page)
</txp:if_category></code>sorry guys, what is article tag, the article url?
txp:article, the tag that displays your articles.
Offline
#11 2006-10-09 10:19:03
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,304
Re: Categories and sections
<code><txp:if_category>
<txp:else />
<txp:article /> (your article tag for the front page)
</txp:if_category></code>sorry guys, what is article tag, the article url?
txp:article, the tag that displays your articles.
I ment what exactly I have to write after article tag, between round brackets on your example? the article url, ID?
Offline
#12 2006-10-09 12:53:06
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Categories and sections
Oh sorry, you don’t have to write anything there. I just meant you have to add the attributes that you want to use (e.g. form=”…”, limit=”…” etcetera) in the article tag.
Offline