How to display a URL for a class member?

Author Message

Andrew Zahra

Wednesday 11 February 2004 8:24:29 pm

I have defined my own class to represent a diagram. As a first step I am trying to customise the display of this class. Eventually I would like to display it inline as part of a larger article. But for starters I thought I would try and customise the display of an individual object of this class.

I have been guessing my way around the templates from the standard ones. Is there any documentation that explains the variables that are automatically populated for a template and their structure? For example, I have deduced that there is a $node and that I can do a $node.object.data_map.<fieldname> where <fieldname> is the field from the class. But is there some docuemntation that describes the $node in detail so I know what all the fields are.

So far I have attempted this as my template. The name and image display correctly, but the URL is completely wrong. I want it to be a link to the binary file (source) in the object.

<div class="pagetitle">
{* Display Name as title. *}
{attribute_view_gui attribute=$node.object.data_map.name}
</div>
<div class="imageleft">
{* Display diagram image. *}
{attribute_view_gui attribute=$node.object.data_map.image}
</div>
{* Display diagram source. *}
<a href={$node.object.data_map.source|ezurl}>{$node.object.data_map.name}</a>

Tore Skobba

Thursday 12 February 2004 2:24:48 am

Hi

For your url you could do: attribute_view_gui attribute=$node.object.data_map.source}. in order to view all attributes for any variable do {$node|attribute(show)}, where $node is the variable you are wondring about.

Tore

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