Hide rightmenu (no tool)

Author Message

Vicente Olivan

Monday 13 November 2006 10:05:50 am

My problem is hiding the space of rightmenu when it doesn´t assigned tool in a toolbar

How to do this? Some documentation?

Thanks

Jacobo Quiles

Tuesday 14 November 2006 12:31:32 am

Hi,

Take a look at this part of your pagelayout.tpl:

{cache-block}
  {let maincontentstyle='maincontent-bothmenus'}

  {section show=eq(ezini('SelectedMenu','LeftMenu','menu.ini'),'')}
      {set maincontentstyle='maincontent-noleftmenu'}
  {/section}

  {section show=ezini('Toolbar_right','Tool','toolbar.ini')|count|eq(0)}
    {section show=$maincontentstyle|eq('maincontent-noleftmenu')}
      {set maincontentstyle='maincontent-nomenus'}
    {section-else}
      {set maincontentstyle='maincontent-norightmenu'}
    {/section}
  {/section}

  <div id="maincontent" class="{$maincontentstyle}">
    <div id="fix">
      <div id="maincontent-design">
  {/let}

{/cache-block}

Make sure your $maincontentstyle var has the value 'maincontent-norightmenu'.

Microblau SL
http://www.microblau.net

Vicente Olivan

Tuesday 14 November 2006 2:21:01 am

Hi, Jacobo

I explain myself not well

- <b>node view</b> | tool in toolbar is not: All right

- <b>node view</b> | tool in toolbars: All right

- <b>node view</b> | tool in toolbar aasigned a node: I don´t like (when it´s not the specific node)

How to switch 'maincontent-bothmenu' for 'maincontent-norightmenu' when when happens this it?

Thanks

Jacobo Quiles

Thursday 30 November 2006 1:08:10 am

Hi Vicente, i am not sure if i still understand what you need.

You need to show the toolbar-right only on certain nodes? If so, just add conditions for setting the maincontent style and to show the toolbar.

Having this example structure:

- Home (node 2)
- Who we are (node 50)
- News (node 51)
- Contact (node 52)

This example will show the toolbar-right if the node being viewed is not the homepage (node 2) or the news folder (node 50):

pagelayout.tpl:
where it shows the toolbar-right:

{section show=ezini( 'Toolbar_right', 'Tool', 'toolbar.ini' )|count}
  {if and( is_set($module_result.node_id), 
      and( ne( $module_result.node_id,2), 
             ne($module_result.node_id,50))} {* <-- node check *}
    <div id="rightmenu">
        <div id="rightmenu-design">
            <h3 class="hide">Right menu</h3>
            <div id="toolbar-right">
                <div class="toolbar-design">
                    {tool_bar name=right view=full}
                </div>{* id="toolbar-design" *}
            </div>{* id="toolbar-right" *}
        </div>{* id="rightmenu-design" *}
    </div>{* id="rightmenu" *}
  {/if}
{/section}

pagelayout.tpl:
where it loads the maincontent style:

{cache-block}

{let maincontentstyle='maincontent-bothmenus'}
  
{section show=eq(ezini('SelectedMenu','LeftMenu','menu.ini'),'')}
    {set maincontentstyle='maincontent-noleftmenu'}
{/section}

{section show=ezini('Toolbar_right','Tool','toolbar.ini')|count|eq(0)} {* <-- Enters here as there is a toolbar-right defined *}
    {section show=$maincontentstyle|eq('maincontent-noleftmenu')}
        {set maincontentstyle='maincontent-nomenus'}
    {section-else}
        {set maincontentstyle='maincontent-norightmenu'}
    {/section}
{/section}

{if and( is_set($module_result.node_id),
     or( eq($module_result.node_id,2), 
          eq($module_result.node_id,50)))} {* <-- node check *}
    {set maincontentstyle='maincontent-norightmenu'} 
{/if}

<div id="maincontent" class="{$maincontentstyle}">
    <div id="fix">
    <div id="maincontent-design">
{/let}

{/cache-block}

Cheers.

Microblau SL
http://www.microblau.net

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 11:42:07
Script start
Timing: Jan 18 2025 11:42:07
Module start 'layout'
Timing: Jan 18 2025 11:42:07
Module start 'content'
Timing: Jan 18 2025 11:42:07
Module end 'content'
Timing: Jan 18 2025 11:42:07
Script end

Main resources:

Total runtime0.7219 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 589.0234152.6250
Module start 'layout' 0.00550.0036 741.648439.4453
Module start 'content' 0.00910.7114 781.0938565.9375
Module end 'content' 0.72050.0013 1,347.031316.1641
Script end 0.7218  1,363.1953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4865160.0002
Check MTime0.00140.1899160.0001
Mysql Total
Database connection0.00060.085710.0006
Mysqli_queries0.660791.5300600.0110
Looping result0.00070.0953580.0000
Template Total0.688595.420.3442
Template load0.00240.337620.0012
Template processing0.686095.039320.3430
Template load and register function0.00010.014810.0001
states
state_id_array0.00140.199310.0014
state_identifier_array0.00140.195520.0007
Override
Cache load0.00210.2885380.0001
Sytem overhead
Fetch class attribute can translate value0.00060.081920.0003
Fetch class attribute name0.00110.151360.0002
XML
Image XML parsing0.00130.185320.0007
class_abstraction
Instantiating content class attribute0.00000.002780.0000
General
dbfile0.00130.1792230.0001
String conversion0.00000.001040.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.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
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/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: 27
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs