Forums / Developer / shorten operator don't display text

"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".

shorten operator don't display text

Author Message

K259

Wednesday 03 August 2005 6:00:11 am

I try to shorten the text displayed with:
{attribute_view_gui attribute=$SearchResult:item.data_map.description|shorten( 15 )}

But I don't think that |shorten works with atribute_view_gui..I don't get any output with just
{$SearchResult:item.data_map.description} so I have to use the attribute_view_gui.

Does anyone know how to solve this?

Guillaume Kempfer

Thursday 04 August 2005 1:10:45 am

Hi,

You cannot do that.
If you want to do that you should create an override of "design/standard/content/searchresult.tpl"

K259

Thursday 04 August 2005 1:43:53 am

Hmm..but do you know how I can output text in a template with the use of this shorten-operator?

I tried:
{$SearchResult:item.data_map.description|shorten(15)}
but it don't output anything..

This works:
{attribute_view_gui attribute=$SearchResult:item.data_map.description}
but then I get all the text from the description field, which makes the searchresultpage a mess..

Paul Borgermans

Thursday 04 August 2005 3:02:24 am

It is possible, look for example this thread:

http://ez.no/community/forum/setup_design/shorten_operator_with_viewing_attributes

You will need to define the striptags template operator (also explained there) if it is about shortening xml attributes. Simple text is simpler.

hth

-paul

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

K259

Thursday 04 August 2005 3:16:35 am

Tnx. Just what I needed, but couldn't find it in the ez search.