Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Use custom fields to link related articles
Because of the way I have this particular website structured, I can’t use the Category fields to link related articles. So I’m left using my keywords field or a custom field to link related articles.
I found a plug in that allows related articles linking using the category fields. However, it doesn’t do it cross category, which rules my site out (since all my related items are in different categories and I can’t add more categories than what I have.)
I believe I found another plug in that does the related articles association through the keyword field, but I’m using the keywords field for meta tags at the moment, which leaves me with custom fields. Does anyone have any suggestions on how to do this? Or is this ripe for a plug-in?
Thanks!
Offline
Re: Use custom fields to link related articles
Suggestions anyone? Or do I need to give more details?
Thanks!
Offline
Re: Use custom fields to link related articles
Could you use something like <code><txp:if_custom_field name=“FieldName” val=“The Value”></code>?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#4 2005-10-18 22:17:09
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Use custom fields to link related articles
Not sure if this would help you?
Offline
Re: Use custom fields to link related articles
(Sorry about the late reply…forgot to subscribe to this thread!) Thanks for the suggestions, however, neither worked for me.
> thebombsite wrote:
> Could you use something like <code><txp:if_custom_field name=“FieldName” val=“The Value”></code>?
The issue was how to get all the articles that had the same value in the custom field to display, so this wasn’t working for me. :/
> doggiez wrote:
> Not sure if this would help you?
I tried that, but couldn’t make it work.
So I broke down and wrote a script to display the appropriate matching articles. You can see it in the left hand columns of these examples:
<a href=“http://www.aprettyrock.com/shop/jet-teardrop-choker”>http://www.aprettyrock.com/shop/jet-teardrop-choker</a>
<a href=“http://www.aprettyrock.com/shop/gold-freshwater-pearl-cluster-y-necklace”>http://www.aprettyrock.com/shop/gold-freshwater-pearl-cluster-y-necklace</a>
I think it works well, so I’m going to stick with it. :)
Offline
#6 2005-10-21 20:46:59
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Use custom fields to link related articles
So I broke down and wrote a script to display the appropriate matching articles.
Nice. So you are using custom fields to display the related articles? Couldn’t you make a plugin out of it? I’m sure lots of people would like that.
Offline
Re: Use custom fields to link related articles
> doggiez wrote:
> bq. So I broke down and wrote a script to display the appropriate matching articles.
Nice. So you are using custom fields to display the related articles? Couldn’t you make a plugin out of it? I’m sure lots of people would like that.
***
I suppose I could. Just don’t know how to get started writing a plug-in. :)
Offline
#8 2005-10-22 02:14:10
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: Use custom fields to link related articles
Templates are here : <a href=“http://forum.textpattern.com/viewtopic.php?id=10330”>Forum</a>, the functions are compiled to a text file, and then loaded under the admin tab. The templates are pretty clear as to how they are laid out.
Offline
Re: Use custom fields to link related articles
Chalk up one vote for that Plug-in.
- )
Tom
Offline
Re: Use custom fields to link related articles
Me too! I could use that…
Offline
Re: Use custom fields to link related articles
I use this method
<code><txp:if_custom_field name=“relatednav” val=“70”>
<txp:article_custom form=“bodyonly” id=“70” />
</txp:if_custom_field></code>
Currently I have a list of all the related navs in a form and I have to manually add one when a new one is created by the authors of the pages. I know this is a clunky way of doing it. But what I would like is the ability to get something like this
<code><txp:if_custom_field name=“relatednav” val=“70”>
<txp:article_custom form=“bodyonly” id=”<txp:custom_field=“relatednav” />”
</txp:if_custom_field></code>
Any suggestions?
Offline
#12 2005-12-20 22:09:30
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Use custom fields to link related articles
Try chh_related_articles?
Offline