How to acces to class attribute

Author Message

Albert Hornos

Wednesday 11 May 2005 3:12:53 am

Hi!
I create a modification of folder class. The new class has an attribute "color" it's a text line with 7 chars.
My problem is that I want that the background color in pagelayout.tpl change when I change the folder.
For example, the main folder is yellow, when I go to products pagelayout should change to blue ...
So I think I should take the attribute "color" of the class folder where I am but I don't know how
Could anyone help me please???

Thanks!!!

Ɓukasz Serwatka

Monday 30 May 2005 1:22:54 am

Hi Albert,

You will have to fetch node data in pagelayout.tpl like

{let node_data=fetch( content, node, hash( node_id, $module_restul.node_id ) )}

   {* check if current node is folder datatype *}

   {* display background color *}
   {$node_data.object.data_map.color.data_text}

{/let}

You can also use section

{* if node id is 2 (folder) show color red *}
{section show=eq( $module_result.node_id, 2 )}
   {* display background color *}
{/section}

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

Albert Hornos

Tuesday 31 May 2005 1:18:39 am

Thanks again Lukasz!!!
Finally I used sections it's given to me more adventatges.

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

eZ debug

Timing: Jan 19 2025 07:17:49
Script start
Timing: Jan 19 2025 07:17:49
Module start 'layout'
Timing: Jan 19 2025 07:17:49
Module start 'content'
Timing: Jan 19 2025 07:17:49
Module end 'content'
Timing: Jan 19 2025 07:17:49
Script end

Main resources:

Total runtime0.0164 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 590.5859152.6250
Module start 'layout' 0.00470.0030 743.210939.4453
Module start 'content' 0.00770.0045 782.656389.4453
Module end 'content' 0.01210.0042 872.101630.3047
Script end 0.0164  902.4063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003219.4793140.0002
Check MTime0.00116.8585140.0001
Mysql Total
Database connection0.00063.798510.0006
Mysqli_queries0.002716.734730.0009
Looping result0.00000.078510.0000
Template Total0.003018.310.0030
Template load0.002112.597610.0021
Template processing0.00095.670810.0009
Override
Cache load0.001710.566810.0017
General
dbfile0.00021.507580.0000
String conversion0.00000.046540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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