Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-11 14:02:10

pietertje
New Member
From: Netherlands
Registered: 2004-02-27
Posts: 9
Website

create a list of articles based on the category of the open article

the normal recent articles didn’t do what i want so i added
<pre>
<code> if($pretext[“c”]){ $category = $pretext[“c”]; }
</code>
</pre>
and it was fine except that the list doesn’t check what kind of category the article is.
is there a way like <code>$pretext[“c”]</code> to get the category of an open article?

Last edited by pietertje (2005-11-11 14:02:47)

Offline

#2 2005-11-11 15:06:48

boblet
Member
Registered: 2005-08-08
Posts: 53

Re: create a list of articles based on the category of the open article

Hey Pietertje,

I have no idea, but I’m pretty sure the plugin rss_suparchive_bycat would have something you could be inspired from, as it has the ability to do this. Maybe it’s this part?

<code>if ($useartcat1 || $useartcat2 || $useartcats) { $ca = safe_row(‘category1, category2’, ‘textpattern’, ‘id=’.$id); extract($ca);</code>

Note in the docs it says:

useartcats
If an article id is in the current page scope, the listing will be filtered by Category1 or Category2 of that article. Can be used for a related articles listing.

HTH

peace – boblet

Offline

Board footer

Powered by FluxBB