Textpattern CMS support forum

You are not logged in. Register | Login | Help

#81 2008-04-08 13:27:17

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

Re: [plugin] [ORPHAN] chh_related_articles

Hi Derola,
Are you trying to output a list of hotels and restaurants near a certain race, where the race is an article, and each hotel or restaurant is an article? Sounds tricky…how are you relating the two at the moment? I didn’t quite understand your post, but maybe <txp:if_different> might be of help?

Offline

#82 2008-04-08 13:59:04

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

Re: [plugin] [ORPHAN] chh_related_articles

nabrown78 dijo:

Hi Derola,
Are you trying to output a list of hotels and restaurants near a certain race, where the race is an article, and each hotel or restaurant is an article?

Yes and I would like to list hotels separately from restaurants.

Any idea or other plugin to make this?

Offline

#83 2008-04-08 14:22:07

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

Re: [plugin] [ORPHAN] chh_related_articles

Derola,
What about using neighborhoods/locations to relate the races and restaurants/hotels — I’m assuming that’s the real relationship? So category1 for each article would be whether it is a race, restaurant, or hotel, and the category2 would be the neighborhood. Then you could output a list of hotels and restaurants in the race article’s neighborhood. You could use <txp:if_different /> to sort them. If you haven’t used that tag before, it’s a little hard to get the hang of but can really come in handy. Check out graphicPush’s tutorial. If you need to slot any hotel or restaurant into more than one neighborhood, you might be able to use rss_unlimited_categories. Does any of that make sense?

Offline

#84 2008-04-08 22:03:33

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

Re: [plugin] [ORPHAN] chh_related_articles

Over and over again it turns out: morning wasn’t made for me ;) This should work (see article_custom, example 3):

Hotels
<txp:article_custom form="gastro_list" category="hotels" />

Restaurants
<txp:article_custom form="gastro_list" category="retsaurants" />

with the “gastro_list” article form containing:
<p><txp:permlink><txp:title /></txp:permlink></p>


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

Offline

#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,195

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: 289
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,195

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

Board footer

Powered by FluxBB