Share » Forums » Setup & design » Can the keywords attribute be used to...

Can the keywords attribute be used to relate objects of different classes?

Can the keywords attribute be used to relate objects of different classes?

Tuesday 27 January 2004 10:42:48 am - 4 replies

Author Message

Barney Gumble

Tuesday 27 January 2004 10:53:42 am

Looks like I might have just answered my own question, using the related objects from within the admin tool and this...

{section loop=$node.object.related_contentobject_array}

Still, any further pointers welcome.

Paul Borgermans

Tuesday 27 January 2004 11:22:04 am

Not with the current keyword datatype. There are new fetch functions for keywords (3.3-2) which you could use and where you can omit a class to fetch all objects of all classes sharing a specific keyword (or even the first x letters).

It's used in the pdf template functions and I used it to build a keyword index where each keyword is listed with all objects. It is obviously more powerful than $node.object.data_map.keywords.content.related_objects

syntax like

{let kwlist=fetch(content,keyword, hash('alphabet',<part or whole keyword>,  {*required*}
                            'classid',<class id>, {*optional, integer*}
                             'offset',<offset>, {*optional, integer*}
                             'limit',<limit> {*optional, integer*}
                           )}  

It returns a weird array with if you loop over it: $kwlist:item.keyword is available only once (facilitating output formatting) and $kwlist:item.link_object has the structure for displaying/linking

Do an {$kwlist:item|attribute(show,2)} and see for yourself. A more extended example will be in "the book".

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Barney Gumble

Tuesday 27 January 2004 11:45:25 am

Thanks Paul that's great. What's the latest news on the book? I need some new bedtime reading...

Bengt Skogly

Tuesday 27 January 2004 12:01:19 pm

What is "the book"?

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu