Share » Forums » Install & configuration » Displaying more information in...

Displaying more information in search.tmp

Displaying more information in search.tmp

Monday 03 February 2003 12:40:10 am - 2 replies

Author Message

Xavier Dutoit

Monday 03 February 2003 4:47:15 am

I wanted to display extra info too. I looked at the variable and its attributes returned by the search and as far as I could see, you only get the url and the title.

(I used the {$var|show} tag to investigate).

I suppose you can fetch content item by item, but that's propably not that fast.

X+

> How do I return more information from an object returned in
> the search.tpl template.
>
> I want to display more than the name and uri to the object.
> For example displaying the intro field underneath.
>
> Any help would be appreciated.

http://www.sydesy.com

Jan Borsodi

Thursday 06 February 2003 2:35:38 am

> How do I return more information from an object returned in
> the search.tpl template.
>
> I want to display more than the name and uri to the object.
> For example displaying the intro field underneath.
>
> Any help would be appreciated.

I suggest you create a new viewmode for content objects, create a viewmode in design/standard/override/templates/content/view/ for all classes you have, for instance search_class_1.tpl and search_class_2.tpl and add the template code to it.
For instance if you have attributes called intro and body for class 1, add:

Intro:
{attribute_view_gui attribute=$object.data_map.intro}

Body:
{attribute_view_gui attribute=$object.data_map.body}

In the search template you must loop over all returned values and do:

{content_view_gui view=search content_object=$:item}

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

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

36 542 Users on board!

Forums menu