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!
|