Skip to content

Commit

Permalink
EZP-24878: eZ Flow Filtering blocks per zone
Browse files Browse the repository at this point in the history
(cherry picked from commit dd6eb9b)
  • Loading branch information
ernestob authored and yannickroger committed Oct 2, 2015
1 parent c078c88 commit 4303b7e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
<div class="object-left">
<select name="ContentObjectAttribute_ezpage_block_type_{$attribute.id}_{$zone_id}">
{def $allowed_zones = false()}
{foreach ezini( 'General', 'AllowedTypes', 'block.ini' ) as $type}
<option value="{$type}">{ezini( $type, 'Name', 'block.ini' )}</option>
{if ezini_hasvariable( $type, 'AllowedZones', 'block.ini' )}
{set $allowed_zones = ezini( $type, 'AllowedZones', 'block.ini' )}
{else}
{set $allowed_zones = false()}
{/if}
{if or( not( $allowed_zones ), and( $allowed_zones, $allowed_zones|contains( $zone.zone_identifier ) ) )}
<option value="{$type}">{ezini( $type, 'Name', 'block.ini' )}</option>
{/if}
{/foreach}
</select>
<input class="button" type="submit" name="CustomActionButton[{$attribute.id}_new_block-{$zone_id}]" value="{'Add block'|i18n( 'design/standard/datatype/ezpage' )}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ RootSubtree=1
# Used by browse mode for manual block,
# possibility to limit block items to specific class
# AllowedClasses[]=article
#
# Limit the zones in which this block can be used
# AllowedZones[]
# AllowedZones[]=right


[DemoBlock]
Name=Demo Block
Expand Down

0 comments on commit 4303b7e

Please sign in to comment.