[fixed] start_level does not work

Forum rules
Only administrators can post or move items here.
archeo
Forum Members
Forum Members
Posts: 104
Joined: Tue Oct 21, 2014 12:47 pm
Location: Lorient (France)

[fixed] start_level does not work

Post by archeo »

Trying to convert this
{menu template="menu_H_3_evolution" start_level='1' number_of_levels="5" }

{menu template="menu_V_evolution" start_level='2' }

{menu template="menu_bas" start_level='3' number_of_levels="1" }

by

{Navigator template="menu_H_3_evolution_V2" start_level='1' number_of_levels="5" }

{Navigator template="menu_V_evolution_V2" start_level='2' }

{Navigator template="menu_bas_V2" start_level='3' number_of_levels="1" }

I noticed that the layout of the page stops just before the first menu. Without start_level=1 the first navigator menu works fine but the other menus are not initiate at level 2 and 3.
Perhaps did I make a mistake, so I consider the template : "Top simple navigation + left subnavigation + 1 column". On his page we can read :

"The {menu} tag

The {menu} tag is inserted twice in the page template. First where the main navigation is, which should only show the top level. It looks like this: {menu template='Simple Navigation' number_of_levels='1'}.

The sub navigation should only contain the second level and down, depending on what is selected on the first level. Also, the third level links should only display when its parent on the second level is clicked, otherwise they are hidden. That is, the second level is collapsed unless the current page has sub pages.

The tag for the sub navigation looks like this: {menu template='simple_navigation.tpl' start_level='2' collapse='1'}."


{menu} or {Navigator}?

In the template the two tag are {Navigator}:

{Navigator loadprops=0 template='Simple Navigation' number_of_levels='1'}

{Navigator loadprops=0 template='Simple Navigation' collapse='1'}

but no start_level parameter here.

Now modify the two tag by

{Navigator loadprops=0 template='Simple Navigation' number_of_levels='1' start_level='1'}

{Navigator loadprops=0 template='Simple Navigation' collapse='1' start_level='2'}

and look at the result. Not good at all.

After suppress start_level='1'. The page layout works but the second menu is missing.
Last edited by archeo on Mon Jul 06, 2015 6:07 pm, edited 2 times in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: start_level does not work

Post by calguy1000 »

I took a brand new installation. changed all pages (except the home page) to use NCleanBlue design and NCleanBlue template.

The NCleanBlue design calls

Code: Select all

{Navigator loadprops=0 template='minimal_menu' start_level=2}
in the footer. and it works just fine.
and look at the result. Not good at all
Does not tell me much. I need to be able to reproduce problems in able to fix them. so please tell me exactly how I can reliably reproduce the issue.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
archeo
Forum Members
Forum Members
Posts: 104
Joined: Tue Oct 21, 2014 12:47 pm
Location: Lorient (France)

Re: start_level does not work

Post by archeo »

I test with "Top simple navigation + left subnavigation + 1 column" template. It is the value "start_level=1" that causes the crash. I test again tomorrow morning on a new installation, I must go to bed now.
archeo
Forum Members
Forum Members
Posts: 104
Joined: Tue Oct 21, 2014 12:47 pm
Location: Lorient (France)

Re: start_level does not work

Post by archeo »

First, to understand my problem look at this two snapshots of Top simple navigation + left subnavigation + 1 column page:
cms V1
there is a menu on the left. It is open on level 2
http://ciavatti.free.fr/cmsv2/cms-v1.JPG
cms-v2
there is no menu on the left
http://ciavatti.free.fr/cmsv2/cms-v2.JPG
have you the same page?

If yes look at cms-v2 template code

Code: Select all

[...]
{* stylesheet  "Navigation Simple - Horizontal" *}
        <h2 class="accessibility">Navigation</h2>
        {Navigator loadprops=0 template='Simple Navigation' number_of_levels='1'}
        <hr class="accessibility" />
[...]
{* Start Sub Navigation, stylesheet  "Navigation Simple - Vertical" *}
            <div id="menu_vert">
              <h2 class="accessibility">Sub Navigation</h2>
              {Navigator loadprops=0 template='Simple Navigation' start_level='2' collapse='1'}
                <hr class="accessibility" />
            </div>
[...]
now replace :

Code: Select all

{Navigator loadprops=0 template='Simple Navigation' number_of_levels='1'}
by

Code: Select all

{Navigator loadprops=0 template='Simple Navigation' number_of_levels='1' start_level='1'}
look at the page
http://ciavatti.free.fr/cmsv2/cms-v22.JPG
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: start_level does not work

Post by calguy1000 »

Okay. thanks.

I think it's fixed now. should be available in the next snapshot.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
archeo
Forum Members
Forum Members
Posts: 104
Joined: Tue Oct 21, 2014 12:47 pm
Location: Lorient (France)

Re: [fixed] start_level does not work

Post by archeo »

It's partly fixed :

with :

Code: Select all

{* stylesheet  "Navigation Simple - Horizontal" *}
        <h2 class="accessibility">Navigation</h2>
        {Navigator loadprops=0 template='Simple Navigation' number_of_levels='1'}
        <hr class="accessibility" />
      </div>
{* End Navigation *}
the page display is correct but with :

Code: Select all

{* stylesheet  "Navigation Simple - Horizontal" *}
        <h2 class="accessibility">Navigation</h2>
        {Navigator loadprops=0 template='Simple Navigation' number_of_levels='1' start_level='1'}
        <hr class="accessibility" />
      </div>
{* End Navigation *}
the horizontal menu is not here
http://ciavatti.free.fr/cmsv2/cms-v23.JPG

try this :

Code: Select all

{* stylesheet  "Navigation Simple - Horizontal" *}
        <h2 class="accessibility">Navigation</h2>
        {Navigator loadprops=0 template='Simple Navigation' number_of_levels='1' start_level='0'}
        <hr class="accessibility" />
      </div>
{* End Navigation *}
the horizontal menu is come back : surprising, no?
archeo
Forum Members
Forum Members
Posts: 104
Joined: Tue Oct 21, 2014 12:47 pm
Location: Lorient (France)

Re: [open] start_level does not work

Post by archeo »

a video to see a difference between V1 and RC1 (same template, Top simple navigation + left subnavigation + 1 column, same hierarchy). Left menu stay on level 2 with V1 and does not with RC1. Is it an internal difference between V1 and RC1 or a difference in menu template coding?

http://ciavatti.free.fr/cmsv2/start_level.avi
archeo
Forum Members
Forum Members
Posts: 104
Joined: Tue Oct 21, 2014 12:47 pm
Location: Lorient (France)

Re: [open] start_level does not work

Post by archeo »

I have tested a little further by adding this code in "Top simple navigation + left subnavigation + 1 column" template :

Code: Select all


<p>Simple Navigation</p>
{Navigator loadprops=0 template='Simple Navigation' start_level='2' collapse='1'}
<p>cssmenu_ulshadow</p>
              {Navigator loadprops=0 template='cssmenu_ulshadow' start_level='2' collapse='1'}
<p>Simple Navigation Menu</p>
{Navigator loadprops=0 template='Simple Navigation Menu' start_level='2' collapse='1'}
<p>Simplex Footer Navigation</p>
{Navigator loadprops=0 template='Simplex Footer Navigation' start_level='2' collapse='1'}
<p>Simplex Main Navigation</p>
{Navigator loadprops=0 template='Simplex Main Navigation' start_level='2' collapse='1'}
<p>minimal_menu</p>
{Navigator loadprops=0 template='minimal_menu' start_level='2' collapse='1'}
<p>cssmenu</p>
{Navigator loadprops=0 template='cssmenu' start_level='2' collapse='1'}
the result is clear : none menu stays on level = 2 when exploring the different levels.

Now replace

Code: Select all

{Navigator loadprops=0 template='Simplex Main Navigation' start_level='2' collapse='1'}
by

Code: Select all

{Navigator loadprops=0 template='Simplex Main Navigation' start_level='3' collapse='1'}
For level value <3, css crash and page stops before template Simplex Main Navigation menu
http://ciavatti.free.fr/cmsv2/start_level32.JPG
For level value >=3, page works but template Simplex Main Navigation menu start at level 1 or 2.
http://ciavatti.free.fr/cmsv2/start_level31.JPG
archeo
Forum Members
Forum Members
Posts: 104
Joined: Tue Oct 21, 2014 12:47 pm
Location: Lorient (France)

Re: [open] start_level does not work

Post by archeo »

tests on snapshot 2015-07-03 00:30

download database here for tests

http://ciavatti.free.fr/cmsv2/cmsrc1.sql(1).zip

then go to ele_1.2 in dropmenu ele_1

http://ciavatti.free.fr/cmsv2/cmsrc1_drop.JPG

you have a menu at level 2 ok that's right

http://ciavatti.free.fr/cmsv2/cmsrc1_ele_12.JPG

now select 1.2.2 in left menu

you have a menu at level 3

http://ciavatti.free.fr/cmsv2/cmsrc1_ele_122.JPG

select 1.2.2.1

at last you have a menu at level 4 that's not right at all

http://ciavatti.free.fr/cmsv2/cmsrc1_ele_1221.JPG

in the same template ("Top simple navigation + left subnavigation + 1 column") there is this menu tag
{menu template='simple_navigationV1' start_level='2' collapse='1'}
under <p>menu</p>
but there is no menu under the text "menu" ???
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: [open] start_level does not work

Post by calguy1000 »

I cross referenced the functionality between MenuManager and navigator.

MenuManager only supports a start_level >= 2
so I implemented that in Navigator.

I also tested the functionality, it seems to be working fine now.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
archeo
Forum Members
Forum Members
Posts: 104
Joined: Tue Oct 21, 2014 12:47 pm
Location: Lorient (France)

Re: [open] start_level does not work

Post by archeo »

It seems that you did not understand the problem (or my english ;) ). So, before spending time in tests could you answer those questions :
1 ) What can I expect when using start_level="2" in "Top simple navigation + left subnavigation + 1 column" template. I expect a left menu fixed at level 2 whatever the level of the page if his level is superior or equal to two. I expect to have all pages of level 2 of level 3 level4 ...level n-1 when I am on level n and when I change page on level 1 all its childrens on left menu.
2 ) how do you perform your tests? Did you use the database I sent in my previous message?

Image
Image
archeo
Forum Members
Forum Members
Posts: 104
Joined: Tue Oct 21, 2014 12:47 pm
Location: Lorient (France)

Re: [open] start_level does not work

Post by archeo »

It is not fixed in snapshot 2015-07-04 12:30 :

The problem begin when the hierarchical level is sup to start_level.

Looking at the code I see you partly use the same code for childrenof (// now do a childrenof the last element.). I agree with that : start_level is a special childrenof fixed at a parent page of the actual page. The good parent page beeing at the start_level in the hierarchy. In the code I don't see where you find the correct page.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: [open] start_level does not work

Post by calguy1000 »

The start_level param should only be displaying the Nth level (>= 2) of the current page.

so given this hierarchy:
page 1 (alias=page_1)
page 1.1
page 1.2
page 1.1.1
page 1.1.2 <-- current page
page 1.1.3
page 1.3
page 2 (alias=page_2)
page 2.1

start_level=2 number_of_levels=1 should display:
page 1.1
page 1.2
page 1.3

because the system literally takes the herarchy of 1.1.2
and rebuilds N levels of the heirarchy i.e: 1.1
it should be exactly equivalent to: childrenof="page_1"

I will test further.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: [open] start_level does not work

Post by calguy1000 »

I setup exactly this page structure in a new svn install and indeed I saw the problem.

and made some very minor changes... it now seems to work as I expect.

should be available in the next snapshot.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
archeo
Forum Members
Forum Members
Posts: 104
Joined: Tue Oct 21, 2014 12:47 pm
Location: Lorient (France)

Re: [open] start_level does not work

Post by archeo »

Don't works on snapshot 2015-07-05 00:30

I try this tag in V1, the result can be use with start_element
(it's part of your article in cms wiki)

Code: Select all

$manager = cmsms()->GetHierarchyManager();

$var = isset($params['assign']) ? $params['assign'] : 'root_page_id';

$result = "NO RESULT";
$thisPage = $smarty->get_template_vars('content_id');
$currentNode = $manager->sureGetNodeById($thisPage);

    $currentContent =& $currentNode->getContent();
    $result = $currentContent->Hierarchy();
//result is the hierarchy of the page
    $currentNode =& $currentNode->getParentNode();
//to test value of start level
$start_level=4;
if ($start_level >2)
//we extract the hierarchy corresponding to start_level
{$result=substr($result,0,$start_level+2);}
else 
{$result=substr($result,0,$start_level+1);}

$smarty->assign($var,$result);
Post Reply

Return to “Closed Issues”