Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
"Related articles" tag limited to specific category
I’m trying to create a page that contains links to articles of the came category.
That is easy enough to do with the txp:related_articles tag.
But here’s the tricky part. I want to create a list of articles that would share one category, but would be limited by some other attribute that is NOT a shared attribute.
In other words, I’d like a list of links to articles that share category1, but are LIMITED to one of the other categories in category2 — but do NOT share that category.
It could be category 2, articles containing an “excerpt,” a specific date, etc.
In other words, let’s say I wanted to create a list of links to all articles that share the category1 “EDUCATION” but are limited to only articles that have category2 “HIGH SCHOOL” even though the article that would contain these links is not category2 = HIGH SCHOOL.
Is there a way to do this?
My published books on Lulu: http://lulu.com/spotlight/forerunner
Offline
#2 2008-06-01 00:32:25
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: "Related articles" tag limited to specific category
In other words, let’s say I wanted to create a list of links to all articles that share the category1 “EDUCATION” but are limited to only articles that have category2 “HIGH SCHOOL”
i.e they share both, cat1 AND cat2, the intersection, right? There’s chh_related_articles Some report of it that it works with 4.0.6, some – including me – had to apply little changes to it.
If I understand you right, you want to display the output of this tag in an article. Just try so, I never tested this.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#3 2008-06-01 01:37:46
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: "Related articles" tag limited to specific category
Just browsed the chh_related_articles “manual” and am not sure, whether it’s the right choice for two categories. But there is brand new smd_query, which is able to realize almost limitless relation queries, just depending on the capabilities of the query writer.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#4 2008-06-01 13:33:18
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: "Related articles" tag limited to specific category
One of your examples can be done with artice_custom and asy_wondertag.
<txp:asy_wondertag>
<txp:article_custom category="<txp:category1 />" excerpted="y" />
</txp:asy_wondertag>
But if I were you I’d have a look at smd_if or smd_query.
Last edited by els (2008-06-01 13:35:08)
Offline
Re: "Related articles" tag limited to specific category
Thanks for the response. I’ll look at smd_if and get back to you.
I think your missing my question though. You are assuming that I mean that articles will appear as links IF the article is related to BOTH
I want to find a way to create related articles links related links that are specific to category2 — but NOT RELATED to CATEGORY2.
It’s would be very strange to me if TXP doesn’t have a plugin that doesn’t allow combinations of ALL, IF and IF AND ONLY IF in generating links.
Let’s say I make a page that I am using for a template for many articles of a certain section. I want to specify that all these articles will appear with links that are related to CATEGORY1 but these will appear IF AND ONLY IF they have CATEGORY2 whether or not they are related.
The example Els gives works only if the article shares the EXCERPTED feature. This would work for me if it would include ALL excerpted articles IF AND ONLY IF they share CATEGORY1.
smd_if looks promising. Let me check it out and get back to you.
My published books on Lulu: http://lulu.com/spotlight/forerunner
Offline
#6 2008-06-01 14:37:41
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: "Related articles" tag limited to specific category
jcr4runner wrote:
The example Els gives works only if the article shares the EXCERPTED feature. This would work for me if it would include ALL excerpted articles IF AND ONLY IF they share CATEGORY1.
That’s what it does as far as I can see… But I must have misunderstood what you want, so if you let us know if smd_if suits your needs (and how), I will probably get it… ;)
Offline