Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
I can't see the obvious: Current category list in article view
I think by now I am a little confused by using TXP too much. :)
I want a list of articles in the current category, but not in the category view (I can do that with some plug-ins) but in the article view.
I want to have an article displayed and on the side a list of the other articles in the same category.
I think it was Obeewan who suggested
<code><txp:chh_article_custom category=”<txp:c />” /></code>
in some other post to get the current category, but that doesn’t work since the TXP tag is ended at the first <code>/></code>. Using
<code><txp:chh_article_custom category=”.” /></code> (which, btw, is not well documented in the plug-in but works great to get the current cat)
only works in list view, not in single article view.
Where am I thinking wrong?
http://ww.spreeblick.de, a weblog from Berlin
Offline
Re: I can't see the obvious: Current category list in article view
Have you tried doing it like this?
<code>
category=”<?php print $GLOBALS[“c”] ?>”
</code>
Offline
Re: I can't see the obvious: Current category list in article view
I did. It doesn’t work because in article view, the category simply just isn’t set anywhere. I also put
<code><?php echo $GLOBALS[“c”] ?></code>
on the page (not within a TXP tag) just to check, it works great whenever I have a category URL like www.server.com/section/?c=name_of_cat in clean mode, but not in an article view like www.server.com/section/12/name_of_article.
There must be a way to pull the cat of the current article. I just don’t know how! :)
http://ww.spreeblick.de, a weblog from Berlin
Offline
Re: I can't see the obvious: Current category list in article view
sorry, i misunderstood. i think your answer is here
Offline
Re: I can't see the obvious: Current category list in article view
Now I only need to understand what the two guys are talking about. :)
Seriously, I find it hard to believe that by now, TXP makes me dig so deep into PHP, which is not my field at all. I thought this is a simple task and I cannot believe that it didn’t cross my way up to now.
Thanks a lot, Wilshire!
http://ww.spreeblick.de, a weblog from Berlin
Offline
Re: I can't see the obvious: Current category list in article view
Did you ever come up with a solution for this?
I’m running into the same thing now trying to list articles from the same category as the current one in an article view.
Offline
Re: I can't see the obvious: Current category list in article view
To solve this problem I just added the ability to do this to the rss_suparchive with the new rss_suparchive_bycat function.
Offline