Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2006-01-05 22:30:47

The-Exit
Member
From: Berlin
Registered: 2005-07-16
Posts: 175
Website

Re: [plugin] [ORPHAN] chh_related_articles

Very great plugin! Thank you.

One question for keywords: how can you separate words?

eg. “credit spread”, “equity”

I would like to get only related articles which have “credit spread” oder “equity” and not “credit” or “spread”. Is the comma separating?

When I get the plugin right, it will use either labels, wraptags etc. or forms? How can I get a label, when I use an article form? Could you integrate a conditional “if related articles” tag? This would be really great!

Offline

#14 2006-01-06 17:50:54

takshaka
Archived Plugin Author
From: Below the Manson-Nixon line
Registered: 2004-06-02
Posts: 97
Website

Re: [plugin] [ORPHAN] chh_related_articles

Just separate the words or phrases with commas: “credit spread,equity”. There should be no space before or after the comma (this will change; the next revision will ignore leading/trailing whitespace).

Also keep in mind that keywords are matched by substring, so that “equity” will also match “home equity” and “gender equity,women’s rights”.

EDIT: You can now use the strict attribute to force exact matches.

Could you integrate a conditional “if related articles” tag?

I take it you don’t want the label (or whatever text) to show unless there are articles listed. That is a problem with all article_custom style form-based lists.

To that end, I wrote a conditional tag (chh_if_not_empty) that I’ve been using myself. Perhaps I should make it available as a plugin, neh?

NOTE: This plugin has appeared, though with a different name: chh_if_data

Last edited by takshaka (2006-02-07 22:39:43)

Offline

#15 2006-01-06 18:55:47

The-Exit
Member
From: Berlin
Registered: 2005-07-16
Posts: 175
Website

Re: [plugin] [ORPHAN] chh_related_articles

Thanks for your anweser.

To that end, I wrote a conditional tag (chh_if_not_empty) that I’ve been using myself. Perhaps I should make it available as a plugin, neh?

Perhaps you can even integrate that to your plugin :-)

Offline

#16 2006-02-07 06:40:31

theonlydrew
Member
Registered: 2006-01-10
Posts: 21

Re: [plugin] [ORPHAN] chh_related_articles

Is it possible to restrict only articles with the “words” listed in custom fields. For instance, there is a currently listed article and I want the related_article tag to list articles that are the same in category, and also have a certain word within a listed articles specified custom field.

If that makes sense. Basically the articles should only list if they have the matching category (this is how they are related), but only those that have a specified “word” listed in a specified customfield, will show. Ummm I basically just repeated myself. Hope you know what I mean! THanks.

Offline

#17 2006-02-07 21:00:11

takshaka
Archived Plugin Author
From: Below the Manson-Nixon line
Registered: 2004-06-02
Posts: 97
Website

Re: [plugin] [ORPHAN] chh_related_articles

Right now, the plugin does not allow you to restrict article listings based on specified keywords or custom field values like chh_article_custom (or txp:article_custom, for that matter). But because it uses the same function library as chh_article_custom, it is something I should add once I have time.

You can, however, specify more than one relation, so that articles will be shown that have the same category and custom field keywords, which may or may not be good enough for your application:

<txp:chh_related_articles relation="category,SomeCustomField" listmode="all" custommode="list" />

Gag. Why did I not make custommode="list" by default? I hate adding that every time.

Offline

#18 2006-02-08 05:39:51

theonlydrew
Member
Registered: 2006-01-10
Posts: 21

Re: [plugin] [ORPHAN] chh_related_articles

Look forward to the update.

Will give ——— txp:chh_related_articles relation=“category,SomeCustomField” listmode=“all” custommode=“list” —— – Some thought.

Thanks a bunch! Again!

Offline

#19 2006-02-10 23:33:14

Freshmango
New Member
From: Braunschweig, Germany
Registered: 2004-06-14
Posts: 7
Website

Re: [plugin] [ORPHAN] chh_related_articles

What a great plugin …

But I have one little problem. Everything works fine until I throw a <code>time=“any”</code> or <code>time=“future”</code> into <code><txp:chh_related_articles /></code>. With <code>time=“any”</code> only past articles are displayed. With <code>time=“future”</code> there will be no article.

Any ideas?

Last edited by Freshmango (2006-02-11 01:09:06)


<a href=“http://dennisfrank.info” title=“Dennis Frank gestaltet – Portfolio” style=“display: block; background:#efefef; color: #545454; float: left; padding: .5em; border: 1px none #9f9f9f; text-decoration: none;”><span style=“border-bottom: 1px solid #9f9f9f;”>Dennis Frank portfolio</span></a>

Offline

#20 2006-02-11 21:43:47

takshaka
Archived Plugin Author
From: Below the Manson-Nixon line
Registered: 2004-06-02
Posts: 97
Website

Re: [plugin] [ORPHAN] chh_related_articles

Ah, I forgot to remove the hard-coded SQL when I added the time attribute.

Fixed: chh_related_articles 0.41

Offline

#21 2006-02-12 01:23:59

Freshmango
New Member
From: Braunschweig, Germany
Registered: 2004-06-14
Posts: 7
Website

Re: [plugin] [ORPHAN] chh_related_articles

Now it works. Thanks!

Oh wait …

It seems that <code>chh_if_data</code> is not working any more with <code>chh_related_articles</code> inside. :-(


<a href=“http://dennisfrank.info” title=“Dennis Frank gestaltet – Portfolio” style=“display: block; background:#efefef; color: #545454; float: left; padding: .5em; border: 1px none #9f9f9f; text-decoration: none;”><span style=“border-bottom: 1px solid #9f9f9f;”>Dennis Frank portfolio</span></a>

Offline

#22 2006-02-12 04:52:00

takshaka
Archived Plugin Author
From: Below the Manson-Nixon line
Registered: 2004-06-02
Posts: 97
Website

Re: [plugin] [ORPHAN] chh_related_articles

I’m using the two together myself. Post your problem in the chh_if_data thread. Be sure to copy/paste the <txp:chh_if_data></txp:chh_if_data> block you are using.

Offline

#23 2006-02-12 23:30:11

rbe
Member
Registered: 2006-02-12
Posts: 27
Website

Re: [plugin] [ORPHAN] chh_related_articles

takshaka, I’m having a problem getting the match by custom field to work… I’ve tried the very basic tag <code><txp:chh_related_articles relation=“custom_1” custommode=“list” /></code> and its not returing everything. I added two articles, both with the word 1928d in the custom_1 field (its name is piano in the admin settings). I’m not getting the related article to showup, however when I use <code><txp:chh_related_articles relation=“keywords” custommode=“list” /></code> and put 1928d in the keywords it works just fine. I’d prefer to use the custom_1 field if possible. I have the tag in a page, rather than an article form – that was the only place I could get anythign to work! Thanks in advance for any help!!!

Offline

#24 2006-02-13 05:47:19

takshaka
Archived Plugin Author
From: Below the Manson-Nixon line
Registered: 2004-06-02
Posts: 97
Website

Re: [plugin] [ORPHAN] chh_related_articles

Looks like specifying custom fields by “custom_n” is not working. I made some changes recently that must’ve wrecked it. I’ll look into that.

You can, however, specify the custom field by name, so relation="piano" should work.

Offline

Board footer

Powered by FluxBB