Forums / General / how to show part of article body content?
kevin wei
Thursday 05 January 2006 3:38:35 am
i just want to show part of content and a 'view full' button?
can EZ do this?
thx!
Per-Espen Kindblad
Thursday 05 January 2006 3:44:51 am
Hi!
You can i.e. show the first 230 letters from the description or text-field, like this:
{$SearchResult:item.data_map.text.content.output.output_text|striptags|shorten(230)}..
and add a link or button to full_view, which is a link to the object (and use the full_class_classid.tpl) to view this.
Siw Helen Thorslund
Thursday 05 January 2006 5:47:18 am
You can easy do that with line and full view. Some info about this here: http://ez.no/community/forum/install_configuration/folders_and_custom_views/re_folders_and_custom_views__1
I did a different approach when I built this site: http://event.modul.no/sasbraathens/index.php/event/cruiseonly
The situation here was to keep the underlaying news when switching to viewing the full article. I added a /(filter)/full to the Les mer-link, and a check.
Like this:
{switch match=$view_parameters.filter} {case match="full"} <div class="attribute-long"> {attribute_view_gui attribute=$node.object.data_map.full_description} </div> {/case} {case} {section show=$node.object.data_map.description.content.is_empty|not} <div class="attribute-long"> {attribute_view_gui attribute=$node.object.data_map.description} </div> {/section} {section show=$node.object.data_map.full_description.content.is_empty|not} <div class="attribute-link"> <a href={concat($node.url_alias,'/(filter)/full/')|ezurl}>{"Read more..."|i18n("design/base")}</a> </div> {/section} {/case} {/switch}
The customer also wanted to be able to display a different content when viewing the full view, so I also added an xml-field (full_description) to the class. The class looks like this: title, intro, description and full_description.
www.VZT.no ( http://www.VZT.no ) VZT References ( http://http://vzt.no/index.php/vzt_eng/referanser ) VZT Extensions ( http://vzt.no/index.php/vzt_eng/extensions ) www.MediaBase.no ( http://www.MediaBase.no )