Forums / Setup & design / Short question

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

eZ debug

Timing: Jan 18 2025 19:19:21
Script start
Timing: Jan 18 2025 19:19:21
Module start 'content'
Timing: Jan 18 2025 19:19:22
Module end 'content'
Timing: Jan 18 2025 19:19:22
Script end

Main resources:

Total runtime1.0351 sec
Peak memory usage4,096.0000 KB
Database Queries210

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0085 588.7188180.8516
Module start 'content' 0.00850.8592 769.5703685.8281
Module end 'content' 0.86770.1673 1,455.3984341.0938
Script end 1.0350  1,796.4922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00460.4407210.0002
Check MTime0.00160.1552210.0001
Mysql Total
Database connection0.00140.132610.0014
Mysqli_queries0.932890.12042100.0044
Looping result0.00290.28312080.0000
Template Total0.997596.420.4987
Template load0.00210.205820.0011
Template processing0.995396.156420.4977
Template load and register function0.00030.024210.0003
states
state_id_array0.00120.113410.0012
state_identifier_array0.00140.136920.0007
Override
Cache load0.00200.1906970.0000
Sytem overhead
Fetch class attribute can translate value0.00190.187550.0004
Fetch class attribute name0.00150.1404100.0001
XML
Image XML parsing0.00200.188950.0004
class_abstraction
Instantiating content class attribute0.00000.0021100.0000
General
dbfile0.00270.2632410.0001
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs