how to show part of article body content?

Author Message

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 )

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 15:15:45
Script start
Timing: Jan 18 2025 15:15:45
Module start 'layout'
Timing: Jan 18 2025 15:15:45
Module start 'content'
Timing: Jan 18 2025 15:15:46
Module end 'content'
Timing: Jan 18 2025 15:15:46
Script end

Main resources:

Total runtime0.6704 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 589.9375152.6406
Module start 'layout' 0.00520.0023 742.578139.4609
Module start 'content' 0.00750.6617 782.0391573.8750
Module end 'content' 0.66920.0012 1,355.914112.1406
Script end 0.6704  1,368.0547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.4529160.0002
Check MTime0.00130.1989160.0001
Mysql Total
Database connection0.00090.135110.0009
Mysqli_queries0.622292.8020590.0105
Looping result0.00050.0699570.0000
Template Total0.644696.220.3223
Template load0.00180.269920.0009
Template processing0.642895.879020.3214
Template load and register function0.00010.016310.0001
states
state_id_array0.00060.091710.0006
state_identifier_array0.00090.130820.0004
Override
Cache load0.00140.2135210.0001
Sytem overhead
Fetch class attribute can translate value0.00060.092630.0002
Fetch class attribute name0.00090.137150.0002
XML
Image XML parsing0.00420.619730.0014
class_abstraction
Instantiating content class attribute0.00000.001750.0000
General
dbfile0.00390.5744190.0002
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs