Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-11-01 14:36:19

Menthol
New Member
Registered: 2007-11-01
Posts: 3

Category Oddities

I am relatively new to Textpattern but have found that it is completely satisfactory as a content manager over being used strictly as a blogging software.

What does not make sense is why the “Browse” pull-down (txp:popup) is included “out-of-the-box” with three Category selections which do not function as expected. One gets the impression that any Article in any Section can be filtered out like a sort of “custom search” for Articles in any Section via the selected Category from the “Browse” popup / pull-down. It is somewhat true if one has setup all of their Sections to be displayed on the front page but that rather kills the ability to have separate, static pages which may have Articles which are tagged by Category.

I truly hope that I have just yet to find the right plugin but being the “Browse” popup / pull-down to select a Category draws the URL domain.com?c=cat_name is going to force the default front page to be displayed. So, if the Category is tied to Articles on static pages which are not set to be displayed on the front page you end up with a blank page.

It’s maddening…

Last edited by Menthol (2007-11-01 14:36:48)

Offline

#2 2007-11-01 16:01:47

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

Re: Category Oddities

You are right, category lists use the front page by default. You can show articles from all sections using txp:article_custom. One way to do it is this:

<txp:if_category name="cat_1">
<txp:article_custom category="cat_1" />
</txp:if_category>

… and so on for every category. But better is to use the asy_wondertag plugin:

<txp:if_category>
<txp:asy_wondertag><txp:article_custom category="<txp:category />" /></txp:asy_wondertag>
</txp:if_category>

You can use this code on the front page, or on a section page (like ‘articles’).

Last edited by els (2007-11-01 16:04:06)

Offline

#3 2007-11-01 16:07:15

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: Category Oddities

not sure if this clears up the issue for you but you can definitely restrict the category to a section via the attribute section=. or by default, it will restrict itself to the current section you’re in. list of attributes here

txp:popup also has attributes which let you specify section as well

Offline

#4 2007-11-01 16:11:22

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

Re: Category Oddities

iblastoff, if you’re showing a category list on a section page, and that section page only has a <txp:article /> tag, articles in that category, but from other sections, won’t be displayed.

Offline

#5 2007-11-01 16:16:08

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: Category Oddities

Els wrote:

iblastoff, if you’re showing a category list on a section page, and that section page only has a <txp:article /> tag, articles in that category, but from other sections, won’t be displayed.

ahh now i see. yah i wasn’t too sure at first what was being asked for, so i tried my best to answer. glad to know there are others more ‘in the know’ than i :)

Last edited by iblastoff (2007-11-01 16:17:13)

Offline

#6 2007-11-01 16:21:13

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

Re: Category Oddities

iblastoff wrote:

wasn’t too sure at first what was being asked for, so i tried my best to answer.

That’s how I do it most of the time ;)

Offline

#7 2007-11-02 02:07:10

Menthol
New Member
Registered: 2007-11-01
Posts: 3

Re: Category Oddities

Excellent…

That did in fact do the trick. No specific category references so the default page template is left generic which was critical. Luckily wondertag was happy being within an if/then…

<txp:if_category>
    <txp:asy_wondertag><txp:article_custom category="<txp:category />" /></txp:asy_wondertag>
<txp:else />
    <txp:article limit="5" />
    <txp:if_individual_article>
        <p><txp:link_to_prev><txp:prev_title /></txp:link_to_prev> 
        <txp:link_to_next><txp:next_title /></txp:link_to_next></p>
    <txp:else />
        <p><txp:older><txp:text item="older" /></txp:older> 
        <txp:newer><txp:text item="newer" /></txp:newer></p>
    </txp:if_individual_article>
</txp:if_category>

Maddness successfully transformed to Wonder! ;)

Thanks!

Last edited by Menthol (2007-11-02 02:08:34)

Offline

Board footer

Powered by FluxBB