Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2005-10-18 15:31:06
- oldi
- Member
- Registered: 2005-10-14
- Posts: 87
Use categories
I am new to txp so sorry for asking something that might be very obvious. I am playing a bit with the leaf templeate and am having some problems with the categories. When i click on one of the categories i want to get a list of all the articles under that category, however i get an empty space.
Do i need a special plugin or do i need to change something from my settings?
thanks a lot
Offline
Re: Use categories
Category lists use the front-page by default so you need to allow the sections that the articles are in to appear on the front-page but not be selected by default. You do that in the “Sections” tab.
Last edited by thebombsite (2005-10-18 19:24:25)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#3 2005-10-18 20:21:51
- oldi
- Member
- Registered: 2005-10-14
- Posts: 87
Re: Use categories
thanks, it worked
Offline
#4 2005-10-18 20:35:39
- oldi
- Member
- Registered: 2005-10-14
- Posts: 87
Re: Use categories
Sorry for coming back.
I followed your example and it worked fine. Tho now i have all my articles showing in the frontpage, which it wasn’t my intetion. I don’t want all my articles to show in the frontpage. I want them to show only in their section. That is why my sections weren’t set to show in frontpage. Can i still have categories working without showing the articles in frontpage? Any plugins for this?
many thanks
Offline
Re: Use categories
Do you have the sections set to not be selected by default? If you have and they are still appearing reset the sections and I’ll go at it another way.
Last edited by thebombsite (2005-10-18 20:53:22)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#6 2005-10-18 21:55:37
- oldi
- Member
- Registered: 2005-10-14
- Posts: 87
Re: Use categories
I double checked and they are set as not being selected by default. I deleted the sections and created them again, but still same result. So any other suggestions?
thanks
Offline
Re: Use categories
Of course. I’m full of suggestions.
Could you grab the glx_if plug-in, install it and activate it. This gives you 2 new tags that you can use like so:-
<code>
<txp:glx_if_category_list>
<txp:article_custom limit=“5” form=“FormName” />
</txp:glx_if_category_list>
<txp:glx_if_frontpage>
<txp:article limit=“5” />
</txp:glx_if_frontpage></code>
<br />
Basically what we are doing here is telling TXP what to do if you are viewing a category list (top) and what to do if you are viewing the front-page (bottom). Don’t put the tags around your paging tags as you want those to appear in both cases. The “form” and “limit” attributes are optional but doing it this way allows you to use a different form for the category listing so, for example, if you used excerpts you could show them for a category listing whilst showing full articles on the normal front-page.
Also in the top block using “article_custom”, which is not context-sensitive like “article” is, allows you to call articles from any section.
Last edited by thebombsite (2005-10-18 22:24:03)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#8 2005-10-18 23:28:06
- oldi
- Member
- Registered: 2005-10-14
- Posts: 87
Re: Use categories
Thanks, that did work. But i have few more questions:
When i click on one category it will show me all the other categories in the same page. for example i have 3 categories books, films, events. when i click on books it will show me the articles that belong to books, films and events. Is there a way of showing only the articles that belong to books? or am i doing something wrong?
also i had to delete
[code]<txp:glx_if_frontpage>
<txp:article limit=“5” />
</txp:glx_if_frontpage>[/code]
because i already had
[code]<txp:article status=“sticky” limit=1 />
<txp:article limit=5 />[/code]
in order to have a sticky article. If i had them both, it would repeat my frontpage articles twice. Is it ok that i have deleted it?
and finally what do you put in form = “FormName” in order to get what you mentioned above.
thanks a lot for your help
am having problems typing the code, you can tell i am a complete beginner. how do i turn on bbcode. anyway am typing it again not as a code. For the first bit i meant
txp:glx_if_frontpage
txp:article limit=“5” /
/txp:glx_if_frontpage
second bit
txp:article status=“sticky” limit=1 /
txp:article limit=5 /
Last edited by oldi (2005-10-18 23:46:46)
Offline
#9 2005-10-18 23:59:47
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: Use categories
The tags as follows for each category you want to look for might be a combination you could use.
<code><txp:if_category name=“yourcatetgory”></code>
<code><txp:article_custom category=“yourcategory” /></code>
<code></txp:if_category></code>
<a href=“http://textpattern.net/wiki/index.php?title=Txp:if_category”> Txp:if_category </a>
Offline
Re: Use categories
Use < code>< /code> (without the spaces) to show code here. Deleting that block was partially correct. What you need to do is surround that second block of code with the <code><txp:glx_if_frontpage></txp:glx_if_frontpage></code> tags to separate it from the category list.
The first block should be surrounded by the <code><txp:glx_if_category_list></txp:glx_if_category_list></code> tags.
As for showing all the categories that doesn’t sound right. Is your site on a host or on your PC/Mac?
You don’t need to use the form=“FormName” but if you wanted to style the category list in a different way to the normal display you could creat a new “article” type FORM template. This might be similar to the “default” FORM template but you can add or remove bits of information that are displayed. You then replace “FormName” with the new form’s name.
Last edited by thebombsite (2005-10-19 02:02:58)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#11 2005-10-19 14:36:17
- oldi
- Member
- Registered: 2005-10-14
- Posts: 87
Re: Use categories
Haven’t had any succes with the categories so far. Am stilling having the same problem when all the categories show.
I tried if_category but all i get is a blank page. Tho I am not sure whether i am doing it right.
yes my site is on a host and you can check it
www.morava.f2s.com/book/
Thanks
Offline
Re: Use categories
I was thinking more in terms of you setting me up with a login so I can have a closer look.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline