Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-10-26 13:02:38

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Link to articles with the same custom field

Wondering if this is possible at all. I’m using glz_custom_fields, if that helps/makes things more difficult.

I want to be able to make a link to a page (search results page?) that shows articles that have the same cutom field value.

For example, I have a custom field called “animal”

In article A, the value of animal is dog. I want to bea able to post a link to other articles where animal=dog something like a hypothetical <txp:custom_field name=“animal” link=“1” />

is this possible?


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#2 2008-10-26 13:08:41

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Link to articles with the same custom field

Maybe I did not understand well, but wouldn’t this work?

<txp:article_custom animal="dog" />

Offline

#3 2008-10-26 13:39:11

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

Re: Link to articles with the same custom field

Try chs_if_urlvar or smd_if to create your custom search results page.

You should be able to link to the page like this (within your article form):

<a href="<txp:site_url />?animal=<txp:custom_field name="animal" />">
Other <txp:custom_field name="animal" /> related articles
</a>

Offline

#4 2008-10-26 13:48:01

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: Link to articles with the same custom field

redbot, nope, want to have a page for each particular custom field set

els, i’ll look into those, see if i can figure it out. :)

thanks to both!


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#5 2008-10-26 14:01:02

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Link to articles with the same custom field

kemie wrote:

redbot, nope, want to have a page for each particular custom field set

Ok. Els is right then.
I suggest you use smd_if against chh_if_urlvar though because is has a lot more flexibility

Offline

#6 2008-10-26 17:28:25

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: Link to articles with the same custom field

In the end, i think i’m gonna solve this through categories… but thanks anyway!


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

Board footer

Powered by FluxBB