[SOLVED] Navigator and {$node}

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
kouala
New Member
New Member
Posts: 6
Joined: Wed Sep 09, 2015 7:51 am

[SOLVED] Navigator and {$node}

Post 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.
Last edited by kouala on Wed Sep 09, 2015 9:10 am, edited 1 time in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Navigator and {$node}

Post 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).
kouala
New Member
New Member
Posts: 6
Joined: Wed Sep 09, 2015 7:51 am

Re: Navigator and {$node}

Post 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
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Navigator and {$node}

Post 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}
kouala
New Member
New Member
Posts: 6
Joined: Wed Sep 09, 2015 7:51 am

Re: Navigator and {$node}

Post by kouala »

Perfect, it's work.

Big Thanks :)
Locked

Return to “CMSMS Core”