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.