Share » Forums » General » Fetch a specific column in a frontpage

Fetch a specific column in a frontpage

Fetch a specific column in a frontpage

Tuesday 17 June 2008 8:05:36 am - 4 replies

Author Message

Felix Laate

Tuesday 17 June 2008 11:42:42 pm

Hi Jeremy,

if you display the text in your left column, then you have fetched the node already, and should be able to reuse it anywhere on your page (presuming you haven't undef'ed it).

Could you please give some more info on how the content of your left column is fetched, what kind of datataype it is and so on?

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Jeremy A

Wednesday 18 June 2008 12:27:51 am

Hi,
Thanks for your answer.
Here is the code :
pagelayout.tpl calls frontpage.tpl to display the main area.
In frontpage.tpl we can find :

<div class="left-column-position">
            <div class="left-column">
            <!-- Content: START  -->
                   {attribute_view_gui attribute=$node.object.data_map.left_column}
            <!-- Content: END -->

The last line display the text I put in the left column. But when I put

 {attribute_view_gui attribute=$node.object.data_map.left_column}

in my header area (in pagelayout.tpl), nothing is displayed, maybe because it's not the same file ?

I have found a 'workaround' : I created a content class with just a text block, added it to my content structure, then I fetch it like a simple node. Then the text is well written. In this way it works very well.
But I don't know wich is the best answer, the cleanest method..

Thanks.
<i>sorry for any mistakes, i'm not english</i>

Felix Laate

Wednesday 18 June 2008 1:03:32 am

Hi again,

you can't reach $node from pagelayout (have a look at this old but very usefull page http://ez.no/ezpublish/documentation/customization/custom_design/template_variables_set_by_ezpublish for more info), but if fetch the node there you should be ok.

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

{attribute_view_gui attribute=$my_node.object.data_map.left_column}

{undef $my_node}

Hope this helps!

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Jeremy A

Wednesday 18 June 2008 1:27:41 am

Hi,
Thank you, but the code doesn't display anything.
But I will stay with my new content class, I think it's the cleanest way to do that.
Thanks again,
Jeremy

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu