Sebastian Schoeller
|
Wednesday 10 February 2010 12:54:33 am
Hi Bin Liu, thanks for the very useful hack. I altered it so that blocks are en-/disabled per layout. {foreach ezini( $attribute.content.zone_layout , 'AllowedBlocks', 'zone.ini' ) as $type}
Afterwards the zone.ini needs to be extended as follows
[GlobalZoneLayout]
ZoneTypeName=Global zone layout
Zones[]=main
ZoneName[main]=Global zone
ZoneThumbnail=globalzone_layout.gif
Template=globalzonelayout.tpl
AvailableForClasses[]=global_layout
AllowedBlocks[]=DemoBlock
AllowedBlocks[]=Manual2Items
AllowedBlocks[]=Manual3Items
AllowedBlocks[]=Manual4Items
AllowedBlocks[]=Manual5Items
AllowedBlocks[]=Dynamic3Items Works and does the job, although your hack is more fine grained. Thanks for the hint and best wishes Sebastian
|
Stefan Eickhoff
|
Wednesday 26 January 2011 1:20:50 am
Hi Bin Liu, very usefull tip, thank you. I use it that way
- use zone_identifier string - use [General]-Block as default
{def $allowedBlocks = cond(ezini( concat($attribute.content.zone_layout,'_', $zone.zone_identifier) , 'AllowedTypes', 'block.ini' )|count(), ezini( concat($attribute.content.zone_layout,'_', $zone.zone_identifier) , 'AllowedTypes', 'block.ini' ), ezini( 'General', 'AllowedTypes', 'block.ini' ))}
{foreach $allowedBlocks as $type}
<option value="{$type}">{ezini( $type, 'Name', 'block.ini' )}</option>
{/foreach}
#block.ini
[MyLayout_left]
AllowedTypes[]=news
AllowedTypes[]=content
[MyLayout_right]
AllowedTypes[]=teaser lg Stefan
|