Forums / Setup & design / how to get data from object within pagelayout template?

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

how to get data from object within pagelayout template?

Author Message

Matt Gifford

Saturday 26 July 2008 8:49:47 am

Hi guys

I am adapting the pagelayout template, as I need a banner object (as in the default frontpage template) to be show in all pages.

I have the standard banner code:

{if $node.object.data_map.billboard.has_content}
<div class="attribute-billboard">
{content_view_gui view=billboard content_object=$node.object.data_map.billboard.content}
</div>
{/if}

From what I can see though, the pagelayout template does not have the $node variable.
How can I access this?

I am seeing the current node ID from the pagelayout template ($current_node_id) which is fine, but I really need to access the object data map to get the billboard.

Any ideas?
Your help would be fantastic.

Many thanks,

Matt

Greg McAvoy-Jensen

Saturday 26 July 2008 9:08:02 am

You'll need to do a fetch, like:

{def $my_node=fetch( 'content', 'node', hash( 'node_id', $module_result.node_id ) )}

$my_node will then have your billboard.

Granite Horizon, Certified Developer of eZ Publish Web Solutions
Provider of the SaaS Solution Granite Horizon In The Cloud | http://granitehorizon.com/cloud
http://granitehorizon.com | +1 916 647 6350 | California USA | @granitegreg
Blog: http://granitehorizon.com/blog

Matt Gifford

Saturday 26 July 2008 9:15:23 am

Greg, thank you so much. You are a legend. :)

Matt Gifford

Wednesday 30 July 2008 4:46:38 am

Hi guys

I'm now trying to extract the url to the image supplied by the banner I have uploaded.

Using the {content_view_gui view=billboard content_object=$node.object.data_map.headerimage.content} method brings back the complete img src tag.

Does anyone know how I can get to just the location/url of the image?

Many thanks,

Matt

Norman Leutner

Wednesday 30 July 2008 6:25:19 am

Hi,

try {$node.object.data_map.headerimage|attribute(show)} to get more information...

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Matt Gifford

Wednesday 30 July 2008 7:24:16 am

Thanks Norman

I get the following returned. I'm still a little confused by it though.

Attribute Type Value

name object[eZContentObjectAttribute]

>id string 1189
>contentobject_id string 190
>version string 1

How can I get the URL from this?

Many thanks,

Matt

Pascal von Büren

Wednesday 30 July 2008 7:36:56 am

Hi Matt,

use something like this:

$node.data_map.headerimage.content.original.full_path

You can also replace the "original" part in the above by any image variation you have defined in your image.ini.append (e.g. medium).

Matt Gifford

Wednesday 30 July 2008 8:21:03 am

Thanks for all of your help so far guys, but I'm still stuck. Badly. :(

Matt Gifford

Wednesday 30 July 2008 8:23:46 am

I've managed to draw the contentobject_id using the following:

{$node.object.data_map.headerimage.image.content.id}

can I get the url from that at all?

Matt Gifford

Wednesday 30 July 2008 9:15:11 am

Got it! After most of the day (aargh!) this works..:

{$node.object.data_map.headerimage.content.data_map.image.content[original].full_path}

Thanks to all for help and advice.