Forums / Install & configuration / Displaying more information in search.tmp

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Displaying more information in search.tmp

Author Message

Stuart Fenton

Monday 03 February 2003 12:40:10 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.

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