version list

Author Message

Valentina Ferrari

Wednesday 01 September 2004 3:09:06 am

Hi all!
I'm trying to show all the versions of an object. Using this code I can view all the object versions from the 5° version to the 1° version.

{* Fetch an object. *}
{let object=fetch( 'content', 'object', hash( 'object_id', $node.contentobject_id ) )}

{* Fetch all versions of this object. *}
{let version_list=fetch( 'content', 'version_list', hash( 'contentobject', $object ) )}

    {* Loop through all versions and display their attributes. *}    
    	{section var=version loop=$version_list}
	<table border="1">
      	{let attribute_list=fetch( 'content', 'contentobject_attributes', hash( 'version', $version ) )}
     	       			{section var=attribute loop=$attribute_list}
						{section show=eq($attribute.content,'')}
						{section-else}
							<tr>			
								<td height="20" valign="top" width="30%">
	     	           			      		<span class="txtazz"><b>{$attribute.contentclass_attribute.name}:</b></span>
								</td>
								<td valign="top">
									{attribute_view_gui attribute=$attribute}
								</td>
							</tr>
						{/section}
     	       			{/section}
     	   			{/let}
  	</table>
	{/section}
{/let}
{/let}

 

So, now I would like to show the version from the 1° to the 5°.
Anyone know how to order the versions?

TIA
Valentina

Valentina Ferrari

Wednesday 01 September 2004 3:16:17 am

Ops! ...I made a mistake!
Now, using this code I show the versions from the 1° to the 5°, but I would like to show versions from the 5° to the 1°.

TIA
Valentina

{* Fetch an object. *}
{let object=fetch( 'content', 'object', hash( 'object_id', $node.contentobject_id ) )}

{* Fetch all versions of this object. *}
{let version_list=fetch( 'content', 'version_list', hash( 'contentobject', $object ) )}

    {* Loop through all versions and display their attributes. *}    
    	{section var=version loop=$version_list}
	<table border="1">
      	{let attribute_list=fetch( 'content', 'contentobject_attributes', hash( 'version', $version ) )}
     	       			{section var=attribute loop=$attribute_list}
						{section show=eq($attribute.content,'')}
						{section-else}
							<tr>			
								<td height="20" valign="top" width="30%">
	     	           			      		<span class="txtazz"><b>{$attribute.contentclass_attribute.name}:</b></span>
								</td>
								<td valign="top">
									{attribute_view_gui attribute=$attribute}
								</td>
							</tr>
						{/section}
     	       			{/section}
     	   			{/let}
  	</table>
	{/section}
{/let}
{/let}

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 19 2025 01:23:09
Script start
Timing: Jan 19 2025 01:23:09
Module start 'layout'
Timing: Jan 19 2025 01:23:09
Module start 'content'
Timing: Jan 19 2025 01:23:09
Module end 'content'
Timing: Jan 19 2025 01:23:09
Script end

Main resources:

Total runtime0.6144 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0088 590.1484152.6094
Module start 'layout' 0.00880.0041 742.757839.4141
Module start 'content' 0.01290.5999 782.1719434.5547
Module end 'content' 0.61280.0016 1,216.726612.5078
Script end 0.6144  1,229.2344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.6511160.0003
Check MTime0.00140.2319160.0001
Mysql Total
Database connection0.00120.193510.0012
Mysqli_queries0.567692.3699520.0109
Looping result0.00070.1218500.0000
Template Total0.572493.220.2862
Template load0.00360.587720.0018
Template processing0.568892.572620.2844
Template load and register function0.00020.039510.0002
states
state_id_array0.00140.225110.0014
state_identifier_array0.00130.206420.0006
Override
Cache load0.00300.4897170.0002
Sytem overhead
Fetch class attribute can translate value0.00080.123910.0008
Fetch class attribute name0.00110.178820.0005
XML
Image XML parsing0.00010.020510.0001
class_abstraction
Instantiating content class attribute0.00000.000820.0000
General
dbfile0.00080.1357100.0001
String conversion0.00000.002040.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/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: 17
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs