eZ Community » Forums » Extensions » eZ Flow » ezflow zone and blocks
expandshrink

ezflow zone and blocks

ezflow zone and blocks

Monday 03 June 2013 4:38:47 pm - 1 reply

How can I specify that for a particular zone in eZ Flow only certain blocks can be allowed to add?
[General]
AllowedTypes[]=ETAusInfoBox
AllowedTypes[]=ETAusMiddle
AllowedTypes[]=ETAusLeftMenu
I want that for top zone only the following 3 blocks should be shown in dropdown list.

Thanks in advance

Friday 09 August 2013 9:58:15 am

Here you go:

1. Copy the file extension/ezflow/design/standard/templates/page/zone.tpl to exstension/<your_backend_extension>/standard/templates/page/zone.tpl
2. Replace this [about line 6]

 <div class="block">
    <label>{'Block type:'|i18n( 'design/standard/datatype/ezpage' )}</label>
    <select name="ContentObjectAttribute_ezpage_block_type_{$attribute.id}_{$zone_id}">
    {foreach ezini( 'General', 'AllowedTypes', 'block.ini' ) as $type}
        <option value="{$type}">{ezini( $type, 'Name', 'block.ini' )}</option>
    {/foreach}
    </select>
</div>

with this:

 <div class="block">
    <label>{'Block type:'|i18n( 'design/standard/datatype/ezpage' )}</label>
    <select name="ContentObjectAttribute_ezpage_block_type_{$attribute.id}_{$zone_id}">
    {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}
    {undef $allowedBlocks}
    </select>
</div>

3. In your block.ini, replace your example with the following:

 [<LayoutName>_<ZoneName>]
AllowedTypes[]=ETAusInfoBox
AllowedTypes[]=ETAusMiddle
AllowedTypes[]=ETAusLeftMenu

Hope that helped.

Modified on Friday 09 August 2013 10:01:29 am by Matthias Krieft

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from