Page 1 of 1

[SOLVED] Navigator and {$node}

Posted: Wed Sep 09, 2015 8:02 am
by kouala
Hello,

I try to use the new Navigtor (CMSMS 2.0) but I need {$node->extra1}. It seems to not work.

Code: Select all

{foreach $data as $node}
  <li class="navigation__item {$liclass} automobile autotablet {$node->extra1}">
{/foreach}
Can you help me please ?

Thanks.

Re: Navigator and {$node}

Posted: Wed Sep 09, 2015 8:44 am
by velden
Example:
{Navigator loadprops=0 template='minimal_menu'}
Make sure 'loadprops' parameter NOT is 0 or false (or don't use it at all).

Re: Navigator and {$node}

Posted: Wed Sep 09, 2015 8:50 am
by kouala
Thanks for your answer but it doesn't work.

I call the menu like this:
{Navigator template='Menu' start_level='2' collapse='1' }

I don't found any full documentation on CMSMS2 ;)

Thanks

Re: Navigator and {$node}

Posted: Wed Sep 09, 2015 9:06 am
by velden
Just tested on default install of CMSMS 2.0

Simplex Main Navigation template

Code: Select all

...
{foreach $data as $node}
           <!-- {$node|print_r} -->
            {* setup classes for the anchor and list item *}
...
In page template:

Code: Select all

{Navigator loadprops='1' template='Simplex Main Navigation'} 
(Personally don't like the quotes around '1' but used the defaults in existing template.)

Then put some text into Extra 1, 2 and 3 input fields of a few pages and refreshed page. This is what's in the source:

Code: Select all

<!-- NavigatorNode Object
(
    [id] => 1
    [url] => http://www.example.com/test/
    [accesskey] => 
    [type] => content
    [tabindex] => 
    [titleattribute] => 
    [modified] => 1441788925
    [created] => 1441708056
    [hierarchy] => 1
    [depth] => 1
    [menutext] => Home
    [raw_menutext] => Home
    [target] => 
    [alias] => home
    [current] => 1
    [parent] => 
    [has_children] => 
    [children_exist] => 
    [default] => 1
    [extra1] => This is the home page extra page attribute 1
    [extra2] => This is the home page extra page attribute 2
    [extra3] => This is the home page extra page attribute 3
)
1 -->
Checked this too and works as expected:

Code: Select all

{if $node->extra1 != ''}<!-- extra1: {$node->extra1} -->{/if}

Re: Navigator and {$node}

Posted: Wed Sep 09, 2015 9:10 am
by kouala
Perfect, it's work.

Big Thanks :)