Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#85 2008-04-08 22:15:42

derola
Member
Registered: 2006-03-09
Posts: 21

Re: [plugin] [ORPHAN] chh_related_articles

Uli, your example show all the Hotels or Restaurants, but the website only must show the Hotels or Restaurant of the race (article)

Each article contain a custom_field called “carrera” with a value (example: Benahavis) this value is for link race (article) with Hotel/Restaurant.

Sorry for me poor english ;)

Offline

#86 2008-04-08 23:33:55

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

Re: [plugin] [ORPHAN] chh_related_articles

If the number of races is limited/constant you could embed my proposal into a “txp:if_custom_field” tag and repeat it as often as necessary, one for each race:

<txp:if_custom_field name="carrera" val="Benahavis"> 
Hotels
<txp:article_custom form="gastro_list" category="Benahavis_hotel" />
Restaurants
<txp:article_custom form="gastro_list" category="Benahavis_restaurant" />
</txp:if_custom_field>

<txp:if_custom_field name="carrera" val="Marbella">
...

It would be necessary then to create two categories for each race.


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

Offline

#87 2008-04-08 23:34:05

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

Re: [plugin] [ORPHAN] chh_related_articles

Hi Derola,
The plugin asy_wondertag may be of use to you. What you want to do is something like this, right:
<txp:article_custom form="permalinked_title" category="<txp:custom_field name="carrera" />" />. With the appropriate code in the form permalinked_title, this would output a list of articles whose category matches the current (race) article’s “carrera” value. Normally you can’t use txp tags as attributes of other txp tags, but asy_wondertag usually allows you to do just that.
Now…I’m thinking that if you want to have a hotel or restaurant listed for more than one race, you run into a problem. But aside from that, this should work.

Offline

#88 2008-04-08 23:45:07

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

Re: [plugin] [ORPHAN] chh_related_articles

Nora, thanks for providing an elegant, less hardcoded solution than mine. That’s what you’ll rarely find in other forums, two people delivering ideas for the same problem :)


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

Offline

#89 2008-04-09 08:11:58

derola
Member
Registered: 2006-03-09
Posts: 21

Re: [plugin] [ORPHAN] chh_related_articles

Thank you guys, with your help seems run ok.

This afternoon, I test it creating many races, hotels… to check it works correctly :)

The code used are:

<txp:asy_wondertag>
<txp:article_custom form="listado" carrera_directorio="<txp:custom_field name="carrera_directorio" />" category="Alojamiento" />
</txp:asy_wondertag>

Offline

#90 2008-04-12 04:11:12

rsskga
Member
From: San Francisco, CA USA
Registered: 2007-06-23
Posts: 50
Website

Re: [plugin] [ORPHAN] chh_related_articles

rad wrote:

BUG FIXED

Thank you for your most helpful suggestion!


Swim Kitten, A Magento Site
When nothing but incredibly revealing dresses and swimwear will do

Offline

#91 2008-06-20 10:28:56

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,357
Website

Re: [plugin] [ORPHAN] chh_related_articles

rad wrote:

BUG FIXED

and Uli questioned replacing the breakclass attribute.

To fix all the errors, follow rad’s instructions and then re-insert the line:

'breakclass' => '',

into the list of attributes (I put it after class).

Adi

Offline

#92 2008-06-20 12:46:35

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

Re: [plugin] [ORPHAN] chh_related_articles

Thanks for posting, Adi!
Have you applied kemie’s patch too? Or is that one just a fix for the same problem in a different place?


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

Offline

#93 2008-06-20 13:02:09

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,357
Website

Re: [plugin] [ORPHAN] chh_related_articles

uli wrote:

Have you applied kemie’s patch

Hi, Uli.

The short answer is no. The long answer is: I don’t think I need to because

  • All the error messages have now disappeared
  • I’m not sure what it actually fixes anyway

But I’ll bear it in mind if things go pear-shaped again.

Thanks,

Adi

Offline

#94 2008-06-20 15:49:00

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

Re: [plugin] [ORPHAN] chh_related_articles

Sorry for the intrusion but I think every feature of this plugin (and lots more) can be achieved now with smd_query.
The same with chh_article_custom

Last edited by redbot (2008-06-20 15:51:35)

Offline

#95 2008-06-20 15:52:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,515
Website GitHub

Re: [plugin] [ORPHAN] chh_related_articles

… if you know SQL :-)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#96 2008-06-20 15:57:00

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

Re: [plugin] [ORPHAN] chh_related_articles

redbot wrote:

Sorry for the intrusion but I think every feature of this plugin (and lots more) can be achieved now with smd_query.
The same with chh_article_custom

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


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

Offline

Board footer

Powered by FluxBB