This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Install & configuration » Displaying more information in...
expandshrink

Displaying more information in search.tmp

Displaying more information in search.tmp

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

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.

Monday 03 February 2003 1:47:15 pm

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.

Thursday 06 February 2003 11: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}

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from