ezflow : adding new zones to existing frontpage objects

Author Message

Alex Vinogradov

Monday 29 November 2010 5:49:55 am

When new zones are added to a layout in zone.ini, existing frontpage objects with that layout don't look like containing those zones. (no tabs in admin interface etc ) Are there any ways to see the change applied ? (apart from hacking ezpagetype.php)

Romeo Antony

Monday 29 November 2010 11:22:22 pm

Hi Alex,

"When new zones are added to a layout in zone.ini,"

Please post your custom zone config code that present in the zone.ini.

"existing frontpage objects with that layout don't look like containing those zones"

may be it is bez you didn't applied the css styling in the right way for newly created zones.

Post the comeplete zone block code.

Second thing check the block array retrived in zones that are in right order as you expect.

Reagrds

Romeo

Alex Vinogradov

Tuesday 30 November 2010 2:12:58 am

thanks for replying, Romeo. I meant when you have something like this in zone.ini :

[my_custom_layout]
Zones[]=right_col

when a frontpage is created and 'my_custom_layout' is applied to it, it will have the 'right_col' zone.

If afterwords I add an entry to ini to have

[my_custom_layout]
Zones[]=right_col
Zones[]=left_col

then the old frontpage object won't contain 'left_col' in its zones array : ($frontpage.data_map.page.content.zones) You cannot add blocks to it cause in admin interface there's no tab corresponding to 'left_col' zone. i don't see what css has to do with it.. hope i was clear.

Romeo Antony

Tuesday 30 November 2010 3:29:20 am

Hi Alex, from your reply I understand like, after adding zones to a custom zone template you are unable to see it.

for instance in zone.ini , it should be like this . I am creating a custom zone called 4ZonesLayout4.

[4ZonesLayout4]
ZoneTypeName=4 zones (layout 4)
Zones[]=lft
Zones[]=midle_lft
Zones[]=midle_rht
Zones[]=rht
ZoneName[lft]=Left zone
ZoneName[midle_lft]=Middle Left zone
ZoneName[midle_rht]=middle Right zone
ZoneName[rht]=Right zone
ZoneThumbnail=4zones_layout4.gif
Template=4zoneslayout4.tpl
AvailableForClasses[]=frontpage

above zone template contain 4 zones, preview like

4 columns ,

4zoneslayout4.tpl will be like follwoing

<div class="zone-layout-{$zone_layout|downcase()}">
<div class="float-break content-columns">
<div class="leftcol-position">
<div class="leftcol">
<!-- ZONE CONTENT: START -->
<div class="border-box">
<div class="border-ml"><div class="border-mr"><div class="border-mc">
<div class="border-content">
{if and( is_set( $zones[0].blocks ), $zones[0].blocks|count() )}
{foreach $zones[0].blocks as $block}
{if or( $block.valid_nodes|count(),
and( is_set( $block.custom_attributes), $block.custom_attributes|count() ),
and( eq( ezini( $block.type, 'ManualAddingOfItems', 'block.ini' ), 'disabled' ), ezini_hasvariable( $block.type, 'FetchClass', 'block.ini' )|not ) )}
<div id="address-{$block.zone_id}-{$block.id}">
{block_view_gui block=$block}
</div>
{else}
{skip}
{/if}

{/foreach}
{/if}
</div>
</div></div></div>
<div class="border-bl"><div class="border-br"><div class="border-bc"></div></div></div>
</div>
<!-- ZONE CONTENT: END -->
</div>
</div>
<div class="mainleftcol-position">
<div class="mainleftcol">
<!-- ZONE CONTENT: START -->
<div class="border-box">
<div class="border-ml"><div class="border-mr"><div class="border-mc">
<div class="border-content">
{if and( is_set( $zones[1].blocks ), $zones[1].blocks|count() )}
{foreach $zones[1].blocks as $block}
{if or( $block.valid_nodes|count(),
and( is_set( $block.custom_attributes), $block.custom_attributes|count() ),
and( eq( ezini( $block.type, 'ManualAddingOfItems', 'block.ini' ), 'disabled' ), ezini_hasvariable( $block.type, 'FetchClass', 'block.ini' )|not ) )}
<div id="address-{$block.zone_id}-{$block.id}">
{block_view_gui block=$block}
</div>
{else}
{skip}
{/if}

{/foreach}
{/if}
</div>
</div></div></div>
<div class="border-bl"><div class="border-br"><div class="border-bc"></div></div></div>
</div>
<!-- ZONE CONTENT: END -->
<!-- COLUMNS TWO: START -->
<!-- COLUMNS TWO: END -->
</div>
</div>
<div class="mainrightcol-position">
<div class="mainrightcol">
<!-- ZONE CONTENT: START -->
<div class="border-box">
<div class="border-ml"><div class="border-mr"><div class="border-mc">
<div class="border-content">
{if and( is_set( $zones[2].blocks ), $zones[2].blocks|count() )}
{foreach $zones[2].blocks as $block}
{if or( $block.valid_nodes|count(),
and( is_set( $block.custom_attributes), $block.custom_attributes|count() ),
and( eq( ezini( $block.type, 'ManualAddingOfItems', 'block.ini' ), 'disabled' ), ezini_hasvariable( $block.type, 'FetchClass', 'block.ini' )|not ) )}
<div id="address-{$block.zone_id}-{$block.id}">
{block_view_gui block=$block}
</div>
{else}
{skip}
{/if}

{/foreach}
{/if}
</div>
</div></div></div>
<div class="border-bl"><div class="border-br"><div class="border-bc"></div></div></div>
</div>
<!-- ZONE CONTENT: END -->
</div>
</div>
<div class="rightcol-position">
<div class="rightcol">
<!-- ZONE CONTENT: START -->
<div class="border-box">
<div class="border-ml"><div class="border-mr"><div class="border-mc">
<div class="border-content">
{if and( is_set( $zones[3].blocks ), $zones[3].blocks|count() )}
{foreach $zones[3].blocks as $block}
{if or( $block.valid_nodes|count(),
and( is_set( $block.custom_attributes), $block.custom_attributes|count() ),
and( eq( ezini( $block.type, 'ManualAddingOfItems', 'block.ini' ), 'disabled' ), ezini_hasvariable( $block.type, 'FetchClass', 'block.ini' )|not ) )}
<div id="address-{$block.zone_id}-{$block.id}">
{block_view_gui block=$block}
</div>
{else}
{skip}
{/if}

{/foreach}
{/if}
</div>
</div></div></div>
<div class="border-bl"><div class="border-br"><div class="border-bc"></div></div></div>
</div>
<!-- ZONE CONTENT: END -->
</div>
</div>
</div>
</div>

do css styling for div classes like zone-layout-4zonelayout4,leftcol-position,leftcol, for every div classes and check through firebug . First you should create a frame for this zonetemplate using css then , style it later on.

Reagrds

Romeo.

Alex Vinogradov

Tuesday 30 November 2010 5:18:49 am

Yeah that's right but say in a future you need to add another zone to this frontpage, so you add these lines to zone.ini (on [4ZonesLayout4] ):

Zones[]=extra_zone
ZoneName[extra_zone]=Extra zone

Then you'll be unable to edit this zone for that frontpage and in 4zoneslayout4.tpl $zones[4] will be undefined. Only if you create new frontpage object with "4ZonesLayout4" layout you'll see that new 'Extra zone'. That was my problem. i could resolve that by making slight changes to ezpagetype.php, but that's not probably the best thing to do. Thank you again.

Romeo Antony

Tuesday 30 November 2010 7:40:06 am

yes .you are correct the same thing happend to me also. In such cases for me the only solution is to remove the frontpage and re publish the frontpage again with the new zones. Hope someone with good experience in ezflow can help you.

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