Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#41 2006-06-24 17:39:25

Registered: 2005-09-10
Posts: 287

Re: [plugin] [ORPHAN] chh_related_articles

is there a way to “tweak” the code so that the list of related articles uses “category2” instead of the “title” when linking to the related articles?

for example, I have articles for an artist’s statement, bio, and resume
each article is assigned two categories:
category1 = the artist’s name
category2 = bio, statement, or resume

the title of the article is Artist’s Name – Bio (or statement, or resume – depending on what it is)
I don’t want the title show up in the related articles list because it is too long and obviously on the artist’s page (artist name not needed)
I just want the related articles list to list each article by it’s category2 designation (Bio, Statement, or Resume)

I am using vdh_flickr to display the artist’s images. On the thumbnails page (this uses a form within the article body of the artist’s gallery), I have placed the following chh_related_articles tag:

<code><txp:chh_related_articles form=“artist_materials” labeltag=“materials” break=“li” wraptag=“ul” /></code>

the form, arist_materials is:
<code><txp:permlink><txp:category2 /></txp:permlink></code>

the problem: nothing appears on the page (not even the vdh_flickr thumbnails) when I use form=“artist_materials” — if I use listform=“artist_materials” (or if I exclude the form attribute), a list appears on the page, but it is not using the artist_materials form (it seems to just ignore it and use the default <code><txp:permlink><txp:title /></txp:permlink> </code> listform)

Maybe there is an easier way to accomplish what I need. If not, the easiest solution I can think of is to somehow alter the chh_related_articles code so that it will, by default, list the permalink to an article using the article’s category2 instead of title.

thanks to anyone who might be able to help!

Last edited by photonomad (2006-06-24 17:40:47)


#42 2006-07-15 22:49:53

Ace of Dubs
Registered: 2006-04-17
Posts: 446

Re: [plugin] [ORPHAN] chh_related_articles

Great job on this plugin, takshaka!

I have used it so much that I have reached the limits of its usefulness. All I have is one request…

It would totally rock if you could call up articles from other categories. For example, I am trying to reach articles whose custom field matches the current article, but belong to various different categories. In an ideal world, this would work

<code><txp:chh_related_articles relation=“custom_1” category=“Dates,Tours,Favorites”/></code>

Instead I am using your custom->keywords trick which works but is sort of confusing for my clients.

I would be willing to donate some funds for the cause. Hope your PHP hasnt gotten rusty :)


#43 2006-07-16 14:49:07

Registered: 2006-02-20
Posts: 296

Re: [plugin] [ORPHAN] chh_related_articles

photonomad, don’t know if it’s still useful, but here’s my piece of advice for your problem :
Prefer using three sections (bio, statement and resume) and naming each article by the artists name. Also, don’t forget the relation attribute in the chh_related_articles tag. In this case it would be
<txp:chh_related_articles relation=“title” form=“artist_materials”/>
the form, arist_materials would be:
<li><txp:permlink><txp:section /></txp:permlink></li>

You’ll be better off by avoiding the combination of forms and tagging attributes.

Last edited by guiguibonbon (2006-07-16 14:50:13)


#44 2006-09-05 19:40:28

From: London, UK
Registered: 2006-07-13
Posts: 14

Re: [plugin] [ORPHAN] chh_related_articles

I’m having a bit of trouble getting chh_related_articles to work for me. What I have is a list of articles, all with Category1 = About and Category2 = Sub. Now I have another group of articles also with Category2 = Sub, but with Category1 = Difference.

Setting chh_related_article with attributes section = ?, relation=category (default), listmode=all, should (AIUI), give me a list of the first articles, but exclude the second articles, as Category1 doesn’t match. Unfortunately, I get a list of both articles.

I think I’ve traced the problem to chh_sql_category, which ignores the $conjunction var, producing a union where I need an intersection. I’ve tried replacing the line in c_r_a where c_s_category is called, and replaced it with a string where I’ve replaced the OR with AND, and I get the results I want.

Unfortunately, I start to lose consciousness following the code – not to mention that I don’t want to start playing with the chh_article_library in case other parts of the webbuild start to unravell.

In any event, I thought I’d mention. I managed to find a work-around by using the custom fields instead. But this is a work-around.

If you’d like to see what I’ve done, I still have the files available. If it would help.


John Anderson
Soaring Penguin


#45 2006-11-04 16:24:12

New Member
Registered: 2006-08-21
Posts: 6

Re: [plugin] [ORPHAN] chh_related_articles

I’m also having trouble with the related articles. I’m trying to relate articles using the built in article Keyword field. I have used:

<txp:chh_related_articles relation="Keywords" />

in a single article form to display related articles by keyword. The TXP is in debugging mode and from the output it looks like the tag is being processed but no output results. Can you suggest something?

<txp:article form="single" limit="1" category="||||cat||||" />
		[SQL (0.001426): select *, unix_timestamp(Posted) as uPosted from txp_textpattern as textpattern where ID = 7 and Status = 4 limit 1]
		[article 7]
		[SQL (0.000939): select Form from txp_txp_form as txp_form where name='single']
		[Form: single]
		<txp:author link="1" />
			[SQL (0.000557): select RealName from txp_txp_users where `name` = 'jsadler' limit 1]
		<txp:chh_related_articles relation="Keywords" />
	<txp:article form="section_home_archive" offset="1" limit="500" sortby="Title" sortdir="asc" />



#46 2006-11-08 16:17:10

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

Re: [plugin] [ORPHAN] chh_related_articles

I have also used <txp:chh_related_articles relation="Keywords" /> , but I get a long list of “tag errors”, seemingly one for each possible attribute, that look like this:
tag_error <txp:chh_related_articles limit="4" relation="keywords" break="li" wraptag="ul" section="article" /> -> Textpattern Notice: Unknown tag attribute: section on line 582

I know this plugin works beautifully on another site I did, with Txp 4.0.3 – I’m wondering if it’s not yet compatible with 4.0.4?
Anyone have a similar problem?


#47 2006-11-08 17:27:18

From: Atlanta, Ga.
Registered: 2004-04-04
Posts: 224

Re: [plugin] [ORPHAN] chh_related_articles

If the tag is actually outputting the results you want (and it probably is), this is a false warning … and … “Warnings are only shown in Testing and Debug modes, they won’t be displayed when your site is set to Live” in admin > preferences.

TextPattern user since 04/04/04


#48 2007-01-12 19:49:37

From: Nashville Tennessee
Registered: 2004-08-25
Posts: 281

Re: [plugin] [ORPHAN] chh_related_articles

Is there an attribute or setting for this plugin that would display all related articles in a category including the article being actively viewed in an individual article.

I don’t want the list to change every time I select an article from the list. I want it to remain static.

Art Rogue – Fine Art Photography


#49 2007-06-16 02:20:07

From: Cologne
Registered: 2006-08-15
Posts: 4,225

Re: [plugin] [ORPHAN] chh_related_articles

I’d need almost exactly the same as mattmikulla: “display all related articles in a category (here: custom_x) including the article being actively viewed”
I’d like to use it for a linked line of numbers, each number representing an article, it’s appearance similar to the pagination known from google (the relation has to be taken from custom field entries, so ob1_googlenav cannot be applied here). Such a navigation is much more user friendly, if the numbers don’t change every time another page is being read. Is there a plugin, that does exactly this job? Or, maybe:
Is it possible to patch chh_related_articles? It might be possible that the plugin itself has a function that subtracts the currently viewed article from an array(?) of all related articles. If so, the concerning line(s) only had to be deactivated. But I don’t have the slightest PHP-expertise to read into the source coe and find these. Or maybe making possible something like «offset=”-1”» which doesn’t work.
I’d appreciate any solution or just a tip, that gets me nearer to what I’m aiming at.

Last edited by uli (2007-06-23 15:09:35)

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


#50 2007-06-23 21:39:11

From: Cologne
Registered: 2006-08-15
Posts: 4,225

Re: [plugin] [ORPHAN] chh_related_articles

BTW, there’s a modification to chh_article_custom by ruud, that can be applied to chh_related_articles as well. It’s for PHP5 installations. If you have PHP4, there’s another solution by ruud two posts below. I’ve tried the one for PHP5: No more errors in test mode!

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


Board footer

Powered by FluxBB