ezwebin:"flat_left.tpl" in override/templates/full/frontpage

Author Message

Maximilien LELEU

Sunday 23 November 2008 6:28:38 am

Hi everybody,

Do you know if it is possible to use the <b>lefft menu (flat_left.tpl)</b> directly in the override template <b>frontpage.tpl</b> ( in the left column) instead of using it in the general template <b>pagelayout.tpl</b> of my design?

I've included it in the frontpage.tpl template and the content of the flat_left.tpl is displayed except the submenu. There is apparently a problem with the variables...

What's wrong with it ? Is there a configuration file to modify or something??

The problem is I do not understand the ezpublish language....

Hope I explained my problem correctly and that someone will be able to help me!!!

Thank you for helping :D

Arnaud Lafon

Monday 24 November 2008 1:33:17 am

Hi,

first, including the menu in the frontpage.tpl is not a good thing. Cuz actually, frontpage.tpl is used as a view template, so it will be processed for each object instantiated on the frontpage class... The left menu must be include in the pagelayout. If you need to custom your homepage, override the pagelayout.tpl and the frontpage.tpl if you want. You should read this document : http://ez.no/doc/extensions/website_interface and at least this part of the documentation http://ez.no/doc/ez_publish/technical_manual/4_0/templates

Then, If your leftmenu template doesn't work, it's certainly because some of the needed variables are set in the pagelayout.tpl and will not be available in the content view template

Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com

Maximilien LELEU

Monday 24 November 2008 2:20:28 am

Hi Arnaud,

Thank you for answering. I understood all that you said but my problem is still the following:

I want a 3 column homepage layout (using frontpage.tpl) but I would like to have the content of the first column (left) under the sidemenu.
I've already tried to keep the left menu in pagelayout.tpl and to use css stylesheets in order to style my homepage this way... but this is simply not possible to achieve...
I've read the Customization guide you suggested carefully and as you can see on the layout structure, the "sidemenu-position" div is located before the "main-position" div . As a result I can't "extract" the left column from the "main-position" div and display it under sidemenu.

I tried another solution: to add a toolbar position under the siedmenu and modify the folder class in order to be able to add content on the right.
Using this solution I can have my sidemenu with some content below, the main content and content on the right. The problem is: The content I can add using the toolbar is rather limited and cannot be different from one page to another. I would prefer to have the frontpage template applied to be able to add objects in both left and right columns

I think I'm in a deadlock...What would you recommend?

Thanks a lot

Arnaud Lafon

Monday 24 November 2008 4:28:19 am

What about including a custom template just after the flat_left include :

{include uri="design:menu/left_menu.tpl"}
{if $some_reason}
{include uri="design:menu/push_frontpagecontent.tpl"}
{/if}

In the new template, you'll be able to use the $module_result variable. Maybe you could fetch the current node by using

{def $current_node = fetch( 'content', 'node', hash( 'node_id', $module_result.node_id ))}
....
....

Actually, you should fetch the $current_node at the top of your pagelayout... Then you'll be able to check anything you want. For exemple $some_reason could be equal to $current_node.class_identifier|eq('frontpage') (ie: you include the push_frontpagecontent.tpl only when you are displaying a frontpage object.

Another thing. When you use the $module_result variable, keep in mind that all the attribute are not always set. For exemple, *.node_id is only defined when the content module is used.
What I often defined at the beginning of my pagelayout is :

{def $current_node_id = first_set( $module_result.node_id, 0 )
    $current_node = cond( $current_node_id|ne(0), fetch( 'content', 'node', hash( 'node_id', $current_node_id )), false )}

Then, you'll have to put some cache-block with the good keys, etc...

Hope this helps

Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com

Richard Lundberg

Friday 05 December 2008 4:28:57 pm

Hi,

You are right, it is not possible to achieve a left menu by changing the pagelayout.tpl as this template will then try to render the left menu before and above the billboard.

One other solution I implemented is to have 2 frontpage objects, one for the main page, and one for sub pages. (similar to article main page and article subpage). I then created a simple menu, (similar to the multipage article menu)

            {* Frontpage index *}
            {def $frontpage_subpages=fetch( content, list, hash( parent_node_id, $used_node.node_id,
                                                              sort_by, $used_node.sort_array ) )}
{if $frontpage_subpages|count}
        
            <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 float-break">

        <h4><a href={$used_node.url_alias|ezurl}>
                 {if $used_node.object.data_map.index_title.has_content}
                    {attribute_view_gui attribute=$used_node.object.data_map.index_title}
                {else}
                    {$used_node.name|wash}
                {/if}
                </a></h4>

            <div class="sidemenu">
            <ul class="menu-list">
            {foreach $frontpage_subpages as $frontpage_subpage}
                {if eq( $node.node_id, $frontpage_subpage.node_id )}
                    <li><a class="selected" href={$frontpage_subpage.url_alias|ezurl}>
                    {if $frontpage_subpage.object.data_map.index_title.has_content}
                        {attribute_view_gui attribute=$frontpage_subpage.object.data_map.index_title}
                    {else}
                        {$frontpage_subpage.name|wash}
                    {/if}
                    </a></li>
                {else}
                    <li><a href={$frontpage_subpage.url_alias|ezurl}>
                    {if $frontpage_subpage.object.data_map.index_title.has_content}
                        {attribute_view_gui attribute=$frontpage_subpage.object.data_map.index_title}
                    {else}
                        {$frontpage_subpage.name|wash}
                    {/if}
                    </a></li>
                {/if}
            {/foreach}
            </ul>
            </div>
            </div></div></div>
            <div class="border-bl"><div class="border-br"><div class="border-bc"></div></div></div>
            </div>
       
{/if}

Then in the left column I call this menu accordingly.
Mainpage

<div class="columns-frontpage float-break">
        <div class="left-column-position">
            <div class="left-column">
                  <div id="sidemenu">
            <!-- Content: START -->
          {include uri='design:menu/left_frontpage.tpl' used_node=$node}
           <!-- Content: END -->
        	     </div>
            </div>
        </div>

Sub page

    <div class="columns-frontpage float-break">
        <div class="left-column-position">
            <div class="left-column">
                  <div id="sidemenu">
            <!-- Content: START -->
          {include uri='design:menu/left_frontpage.tpl' used_node=$node.parent}
           <!-- Content: END -->
        	     </div>
            </div>
        </div>

Hope this helps............

www.peakm3.com

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 31 2025 06:24:19
Script start
Timing: Jan 31 2025 06:24:19
Module start 'layout'
Timing: Jan 31 2025 06:24:19
Module start 'content'
Timing: Jan 31 2025 06:24:19
Module end 'content'
Timing: Jan 31 2025 06:24:19
Script end

Main resources:

Total runtime0.0138 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 588.3906151.2422
Module start 'layout' 0.00490.0023 739.632836.7109
Module start 'content' 0.00720.0053 776.3438102.3438
Module end 'content' 0.01250.0012 878.687541.9922
Script end 0.0137  920.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002014.8563140.0001
Check MTime0.00096.8876140.0001
Mysql Total
Database connection0.00074.983210.0007
Mysqli_queries0.002316.938830.0008
Looping result0.00000.072610.0000
Template Total0.00096.510.0009
Template load0.00064.585410.0006
Template processing0.00031.894010.0003
Override
Cache load0.00042.995810.0004
General
dbfile0.001812.875880.0002
String conversion0.00000.058840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs