Short question

Author Message

Ahmed El Safty

Tuesday 06 February 2007 7:13:55 am

Hi,

I can't really find any answer via search, so forgive me.

I want to access, i.e. get the "url_alias" of a gallery.

I set up the gallery under the folder multimedia, this gallery is self-contained.

Now, I have a article class with a gallery "attribute", so I can reference the former gallery from within the article.

I can see the first pic of the gallery with this:

{attribute_view_gui attribute=$node.object.data_map.galerie} (article.tpl)

But what goes in here <a href={$node.object.data_map.galerie................}></a>, so I retrieve the correct url???

thanks, folks.

Łukasz Serwatka

Wednesday 07 February 2007 3:42:38 am

Hi,

What kind of datatype is your attribute?

You can always investigate objects and arrays with attribute() tpl operator.

{$node.object.data_map.galerie|attribute(show,1)}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Ahmed El Safty

Wednesday 14 February 2007 7:08:58 am

Hi and sorry that I been so late answering. But i had other issues ;-)

I appreciate your answer though..

See.. this is the output of the attribute:

Type Value
id string 1339
contentobject_id string 283
version string 10
language_code string 'ger-DE'
language_id string 2
contentclassattribute_id string 232
attribute_original_id string 0
sort_key_int string 284
sort_key_string string ''
data_type_string string 'ezobjectrelation'
data_text string ''
data_int string 284
data_float string 0
contentclass_attribute object[ezcontentclassattribute] Object
contentclass_attribute_identifier string 'galerie'
contentclass_attribute_name string 'Galerie'
can_translate integer 1
is_information_collector string 0
is_required string 0
content object[ezcontentobject] Object
has_http_value boolean false
value object[ezcontentobject] Object
has_content boolean true
class_content array Array(3)
object object[ezcontentobject] Object
object_version object[ezcontentobjectversion] Object
view_template string 'ezobjectrelation'
edit_template string 'ezobjectrelation'
result_template string 'ezobjectrelation'
has_validation_error boolean false
validation_error NULL
validation_log NULL
language object[ezcontentobjectattribute] Object
is_a string 'ezobjectrelation'
display_info array Array(4)
class_display_info array Array(2)

So how can I retrieve the URL to get to the full view of the gallery?

greetz

Björn Dieding@xrow.de

Wednesday 14 February 2007 7:14:18 am

{$object.main_node.url_alias}

or

{$node.url_alias}

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Ahmed El Safty

Wednesday 14 February 2007 7:39:04 am

This does not work! Maybe my first post was not clear..sorry

1. I have a gallery set up with some pictures.
2. This gallery is referenced by an article, as an Object relation.
3. So gallery is an attribute of an article object.
3. When I reference the gallery in the article full view template with attribute_view_gui I can see the first image of the gallery, but I cannot retrieve the proper url for displaying the whole gallery.

What I need is a generic url to gallery in the article class: My code in the template:

{if $node.object.data_map.galerie.has_content}

{def $audi=fetch('content', 'node', hash('node_id' , 265) ) }
<div class="attribute-long">

<p><a href={$audi.url_alias|ezurl()}>{attribute_view_gui attribute=$node.object.data_map.galerie}</a></p>

</div>

{/if}

The variable $audi is a direct fetch of the gallery and therefore I can retrieve a working url with url_alias.

BUT: I don't need no $audi variable, I need a generic variable.

so i can get the correct url from $node.object.data_map.galerie (a object relation in the article class)

hope it is clearer now. thanks

Bruce Morrison

Wednesday 14 February 2007 11:27:23 pm

Hi Ahmed

I'm assuming that $node.object.data_map.galerie is a realted object datatype

{if $node.object.data_map.galerie.has_content}

{def $audi=$node.object.data_map.galerie.content.main_node}
<div class="attribute-long">

<p><a href={$audi.url_alias|ezurl()}>{attribute_view_gui attribute=$node.object.data_map.galerie}</a></p>

</div>

{/if}

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Ahmed El Safty

Tuesday 20 February 2007 3:48:36 am

Hi Bruce,

Perfect. Thats exactly what I was looking for.

Thanks man..

cheers, ahmed

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