Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#97 2008-06-20 16:46:11

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

Re: [plugin] [ORPHAN] chh_related_articles

uli wrote:

Yes this is something for wimps who like guard-rails ;)

For the record I’m a certified ignorant with sql but nonetheless, with a little effort, I’ve managed to elaborate some simple query. So I think everybody can.
Anyway you’re right, I didn’t think about that and didn’t want to sound like a bragger ;)

Offline

#98 2008-06-20 16:54:34

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,238

Re: [plugin] [ORPHAN] chh_related_articles

Np :)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#99 2009-06-17 19:08:40

nabrown78
Member
From: Boston, MA, USA
Registered: 2006-10-04
Posts: 291
Website

Re: [plugin] [ORPHAN] chh_related_articles

I’ve found this plugin quite handy on a number of sites. It’s easy to use to relate articles via something other than categories. I’d second adding its functionality to txp’s core. You’ve already got the <txp:related_articles /> tag, its functionality just needs to be expanded (easier said than done, I know!).

Thank you for posting this fix, by the way.

Offline

#100 2009-08-17 07:59:02

ronan
Member
From: luzern (schweiz)
Registered: 2008-05-02
Posts: 53
Website

Re: [plugin] [ORPHAN] chh_related_articles

hello

i need a wrapper for the related posts like <p> or <div>. my actualy code:

<p><txp:chh_related_articles relation="keywords" label="Verwandte Artikel: " labeltag="strong" limit="5" break=", " /></p>

the problem: if no related post exist, the wrapper is empty and invalid. what i need is someting like <txp:chh_if_related_articles />.
has everyone a solution for my problem?

greets

andi

Last edited by ronan (2009-08-17 07:59:35)

Offline

#101 2009-08-17 10:05:08

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,238

Re: [plugin] [ORPHAN] chh_related_articles

wraptag="p"?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#102 2009-08-17 11:53:32

ronan
Member
From: luzern (schweiz)
Registered: 2008-05-02
Posts: 53
Website

Re: [plugin] [ORPHAN] chh_related_articles

wraptag don’t include the label. but thanks for your input.

Offline

#103 2009-08-17 16:36:59

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,238

Re: [plugin] [ORPHAN] chh_related_articles

ronan wrote:

wraptag don’t include the label.

Sorry, I obviously still don’t understand.

Do you mean labeltag="p"? If this is not helpful, there’s chh_if_data in order to remove empty <p>s from your code example …


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#104 2009-08-17 16:45:00

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

Re: [plugin] [ORPHAN] chh_related_articles

Or variable and if_variable :)

<txp:variable name="hasarticles" value='<txp:chh_related_articles relation="keywords" limit="1" />' />

<txp:if_variable name="hasarticles" value="">
<txp:else />
	<p><txp:chh_related_articles relation="keywords" label="Verwandte Artikel: " labeltag="strong" limit="5" break=", " /></p>
</txp:if_variable>

Last edited by els (2009-08-17 16:45:55)

Offline

#105 2009-08-17 18:20:57

ronan
Member
From: luzern (schweiz)
Registered: 2008-05-02
Posts: 53
Website

Re: [plugin] [ORPHAN] chh_related_articles

uli labeltag wrap the label only, wraptag the article-output. i need a solution to wrap both in a element. the was, when no articles exist, the p-element was empty. els your awesome, it works like a charme :)

thanks!

Offline

#106 2011-04-08 17:31:27

nabrown78
Member
From: Boston, MA, USA
Registered: 2006-10-04
Posts: 291
Website

Re: [plugin] [ORPHAN] chh_related_articles

This is a really handy plugin for outputting a list of articles related to the current article by Keyword. Can anyone think why it might not be working in TXP 4.3.0? I think it was working fine for me, and I upgraded a bit ago, and just noticed it now seems to be outputting just the 3 most recent articles, for every article. Mysterious.

Offline

#107 2011-04-09 15:29:15

nabrown78
Member
From: Boston, MA, USA
Registered: 2006-10-04
Posts: 291
Website

Re: [plugin] [ORPHAN] chh_related_articles

Aha. I realized that this plugin is doing a simple match, and sorting the results by date or whatever you specify. What I really want is to sort by some kind of relevance. Like an article that shares 3 Keywords with the current article is more relevant than one that shares only 2 Keywords.

I got as far as checking out the MySQL functions MATCHAGAINST…but I’m stumped. Would anyone know how to modify this plugin to achieve sorting by relevance? Or more simply, how to just write the correct MySQL query?

Offline

#108 2012-01-17 12:07:55

jens31
Plugin Author
From: munich / dtschermani
Registered: 2008-08-25
Posts: 183
Website

Re: [plugin] [ORPHAN] chh_related_articles

ola nabrown78

did you come closer to the goal of relevance..? sounds interessting..

Offline

Board footer

Powered by FluxBB