Forums / General / Fetch a specific column in a frontpage

Fetch a specific column in a frontpage

Author Message

Jeremy A

Tuesday 17 June 2008 8:05:36 am

Hello,

I have a frontpage composed of 3 columns (left, center, right). I would like to fetch the text from the left column (in order do display it in the header).
I have tried several fetch functions without any success. My frontpage id is 66 and my left column id is 249.

Any help would be very appreciated.
Thanks,
Jeremy

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

eZ debug

Timing: Jan 31 2025 00:39:05
Script start
Timing: Jan 31 2025 00:39:05
Module start 'content'
Timing: Jan 31 2025 00:39:05
Module end 'content'
Timing: Jan 31 2025 00:39:05
Script end

Main resources:

Total runtime0.1733 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 589.0781370.2969
Module start 'content' 0.00640.0161 959.37501,005.6250
Module end 'content' 0.02250.1508 1,965.00003,893.9609
Script end 0.1732  5,858.9609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00472.6922200.0002
Check MTime0.00140.8018200.0001
Mysql Total
Database connection0.00060.367510.0006
Mysqli_queries0.079045.58551410.0006
Looping result0.00110.62661390.0000
Template Total0.150386.710.1503
Template load0.00090.526810.0009
Template processing0.149486.195810.1494
Override
Cache load0.00060.353610.0006
Sytem overhead
Fetch class attribute can translate value0.00171.005010.0017
XML
Image XML parsing0.00030.150510.0003
General
dbfile0.00854.8919200.0004
String conversion0.00000.002830.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs