Forums / Setup & design / Display values..

Display values..

Author Message

enigmista enigmista

Tuesday 02 September 2003 2:42:20 am

Hi. I am evalutating ez3 and i think that it is very very powerful.However i have a little problem with undestanding the displaying of objects.Sorry for my english i give you an example.. I have a object "Comunicati" that have the following attributes: name, data_di_pubblicazione.I have a section "Comunicati" and a pagelayout_comunicati.tpl for display a complete list of comunicati. In this template with the code:

{let children=fetch('content',list,hash(parent_node_id,$node.node_id))}
<ul>
{section name=Child loop=$children}
<li>{node_view_gui view=line content_node=$Child:item} <span>( {$Child:item.body} )</span></li>
{/section}
</ul>
{/let}

i can see a list that contains a list of comunicati. If i want display data_di_pubblicazione for each comunicato? How i can do? There is a good doc for undestanding this? Tnx a lot

Bjørn Kaarstein

Tuesday 02 September 2003 2:47:56 am

The naming convention has been changed for ezP3.1.

Take a look here: http://ez.no/developer/ez_publish_3/documentation/customization/custom_design/override_templates

Regards Bjørn

enigmista enigmista

Tuesday 02 September 2003 2:56:05 am

Not useful this for me.. i have understand this

Bjørn Kaarstein

Tuesday 02 September 2003 3:48:51 am

Sorry, then I must have misunderstood you.

If you'd like to see what attributes is available for your item, you could try {$:item|attribute(show)}, or {$:item.data_map|attribute(show)}.

I suppose "data_di_pubblicazione" is the publication date of your article. I think you can access this directly with {$:item.object.published|datetime(custom, '%d.%m.%y - %H:%i:%s')} without having it as an own attribute to your class.

Hope this helps.

Regards Bjørn

enigmista enigmista

Tuesday 02 September 2003 5:36:54 am

>Sorry, then I must have misunderstood you.

No no it is my english...

>If you'd like to see what attributes is available for your item, you could try {$:item|attribute(show)}, or {$:item.data_map|attribute(show)}.

No i know they.I have diffuculties with print it in templates

> I suppose "data_di_pubblicazione" is the publication date of your article. I think you can access this directly with {$:item.object.published|datetime(custom, '%d.%m.%y - %H:%i:%s')} without having it as an own attribute to your class.
Oh very useful... but if i want modify date?

Thanks

Bjørn Kaarstein

Tuesday 02 September 2003 6:22:32 am

If you manually want to edit your date and time, you'll have to use your "data_di_pubblicazione" attribute.

I think you can display it something like this:

{$:item.data_map.data_di_pubblicazione.data_int|l10n(date)}

Here's some more on usage of date/datetime: http://ez.no/developer/ez_publish_3/documentation/development/libraries/ez_template/operators/miscellaneous

Regards Bjørn

enigmista enigmista

Tuesday 02 September 2003 6:46:30 am

If you manually want to edit your date and time, you'll have to use your "data_di_pubblicazione" attribute.

I think you can display it something like this:

{$:item.data_map.data_di_pubblicazione.data_int|l10n(date)}

Here's some more on usage of date/datetime: http://ez.no/developer/ez_publish_3/documentation/development/libraries/ez_template/operators/miscellaneous

Ok thanks for your useful help. Now it works... but if i want display data in comunicato.tpl?(not data_di_pubblicazione but the data when object was published)

This is my template
<h1>Comunicati</h1>
<h2>{attribute_view_gui attribute=$node.object.data_map.titolo}</h2>
<div class="comunicato-data"><span>Pubblicato il:</span> HERE I WANT DATE</div>
{attribute_view_gui attribute=$node.object.data_map.lead_in}
{attribute_view_gui attribute=$node.object.data_map.body}

Bjørn Kaarstein

Tuesday 02 September 2003 7:07:54 am

Replace "HERE I WANT DATE" with
{attribute_view_gui attribute=$node.object.published|datetime(custom, '%d.%m.%y - %H:%i:%s')}

might do the trick?

It might even be sufficient to use {$node.object.published|.....}

Good luck

Regards Bjørn

enigmista enigmista

Tuesday 02 September 2003 7:50:27 am

{$node.object.published|datetime(custom, '%d.%m.%y - %H:%i:%s')} works thanks a lot for all