Ez Publish 4.3 Design Configuration

Author Message

Eric Handler

Wednesday 01 September 2010 6:47:27 am

I am working on setting up a site using Ez Publish 4.3 with ezwebin. While doing this I am trying to create a leftmenu on the public side of the site. I was able to create and get the side menu running the way I would like on all the sub pages of the site, but the top level site, which is part of the class "frontpage" displays the sidemenu but doesn't populate the content as I would like. In my siteaccess that I created by copying ezwebin to a new location, I modified frontpage.tpl at line 1-3 from:

 {set scope=global persistent_variable=hash('left_menu', false(),
                                           'extra_menu', false(),
                                           'show_path', false())}

to

 {set scope=global persistent_variable=hash('left_menu', true(),
                                           'extra_menu', false(),
                                           'show_path', false())}

This is what made the side menu display, but I can't find in my searching of the internet what to add to frontpage.tpl to populate the menu with the names of the subcontent below it. Also, I added the appropriate [LeftIdentifierList] entries for my content classes to [MenuContentSettings] in menu.ini.append.php

What do I need to do to frontpage.tpl to make this work?

André R.

Wednesday 01 September 2010 9:23:00 am

your better of using a different class, for instance folder, frontpage is meant to cover the whole width, lots of css and code that you will have to fight.

Use advance -> swap node from context menu (the one on icons) in admin to change object of root node to something else.

As for getting things to show up in left menu, well, the children are shown in top menu I guess?
So to customize something for left menu, use your own left menu by setting a string (name of template within menu folder without ".tpl" suffix) on 'left_menu' instead of "true()".

for templates/menu/frontpage_left_menu.tpl:

{set scope=global persistent_variable=hash('left_menu', 'frontpage_left_menu',

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Eric Handler

Wednesday 01 September 2010 1:08:08 pm

I'm an Ez Publish newbie, so most of my progress has been trial and error based on all the documentation that says copy ezwebin and modify that.

I am not sure I follow your instructions. I swapped root to make it a folder rather than a front page. At this point I don't quite get what you are suggesting so I have tried to explain what I am trying to do

For Home I want to have the left menu duplicate the "Products", "About Us", "Careers" links that appear in the top menu as they are the three nodes (Class=Frontpage) inside the root folder. However, when I navigate to "About Us" I would like to have it show the sub pages of "About Us" which are articles about each employee on the side menu. Does this clarify what I am attempting to do?

Additionally, creating the new site has made me realize that I am having a hard time finding documentation about creating and modifying templates, any suggestions on where to find some helpful guides on creating custom classes and templates to define the appearance of those new classes?

Anaya P

Friday 10 September 2010 8:15:34 am

hopefully I have understood you right. You need to change page_leftmneu.tpl. Try below code and if this is what you want, then create your custom extension and override page_leftmenu.tpl(with below content) in there.

<code>

<div id="sidemenu-position">
<div id="sidemenu">
{if $module_result.content_info.class_identifier|eq('frontpage')}

{if is_array( $pagedata.left_menu )}
{foreach $pagedata.left_menu as $left_menu}
{include uri=concat('design:menu/', $left_menu, '.tpl')}
{delimiter}
<div class="hr"></div>
{/delimiter}
{/foreach}
{else}
{include uri=concat('design:menu/', $pagedata.left_menu, '.tpl')}
{/if}

{else}

{def $sub_menu=treemenu($module_result.path, $module_result.node_id,
array('standard_page','folder','contact_form','sub_page','link', 'frontpage', 'global_layout'), 1, 3) }
<div class="border-box">
<div class="border-tl">
<div class="border-tr">
<div class="border-tc"></div>
</div>
</div>
<div class="border-ml">
<div class="border-mr">
<div class="border-mc">
{if eq( $module_result.node_id, 2 ) }
{let $tmp_root_node=fetch( content, node, hash( node_id, 2 ) )}
<h4>{$tmp_root_node.name}</h4>
{/let}
{else}
<h4>{$module_result.path[1].text}</h4>
{/if}
<ul class="menu-list">
{def $last=0}
{foreach $sub_menu as $s_menu}
{if and($last|ne(0), $last.level|gt($s_menu.level))}{* this if second level is open *}
</ul>
</li>
{/if}
<li> {if and($last|ne(0), $last.level|lt($s_menu.level))}{* this if there is no second level *}
<ul>
<li>{/if}<a {if $s_menu.is_selected} class="current"{/if} href={$s_menu.url_alias|ezurl}>{$s_menu.text}</a></li>
{set last=$s_menu}
{/foreach}
</ul>
{undef $last}
{undef $sub_menu}
</div>
</div>
</div>
<div class="border-bl">
<div class="border-br">
<div class="border-bc"></div>
</div>
</div>
</div>
{/if}
</div></div>

</code>

As you will notice in above code, there is an array of class name defined, so if you want any of the page to appear in the left column, you need to add class name for that page in that array, for your reference below is the code -

<code>

{def $sub_menu=treemenu($module_result.path, $module_result.node_id,
array('standard_page','folder','contact_form','sub_page','link', 'frontpage', 'global_layout'), 1, 3) }

</code>

Hope this helps!

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 18 2025 15:16:01
Script start
Timing: Jan 18 2025 15:16:01
Module start 'layout'
Timing: Jan 18 2025 15:16:01
Module start 'content'
Timing: Jan 18 2025 15:16:01
Module end 'content'
Timing: Jan 18 2025 15:16:01
Script end

Main resources:

Total runtime0.8819 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.1484152.6406
Module start 'layout' 0.00560.0031 741.789139.4609
Module start 'content' 0.00860.8721 781.2500605.9219
Module end 'content' 0.88070.0012 1,387.171916.1563
Script end 0.8819  1,403.3281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3753160.0002
Check MTime0.00130.1529160.0001
Mysql Total
Database connection0.00060.072210.0006
Mysqli_queries0.821093.0929620.0132
Looping result0.00050.0596600.0000
Template Total0.855697.020.4278
Template load0.00190.212620.0009
Template processing0.853796.799620.4268
Template load and register function0.00010.011110.0001
states
state_id_array0.00060.071110.0006
state_identifier_array0.00140.164220.0007
Override
Cache load0.00170.1956910.0000
Sytem overhead
Fetch class attribute can translate value0.00040.046130.0001
Fetch class attribute name0.00070.082250.0001
XML
Image XML parsing0.00080.086230.0003
class_abstraction
Instantiating content class attribute0.00000.001250.0000
General
dbfile0.00080.0855170.0000
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs