Hey
I'm working up a bootstrap 3 navigator template
In 2.0 Navigator if I specify
<a href="{$node->url}">{$node->menutext}</a>
For a third level page (a child page of a section header) e.g:
domain.com/section-header/third-level-1
{$node->url} is giving me the URL
http://www.domain.com/third-level-1
ignoring the section header alias (section-header).
I was expecting the URL: domain.com/section-header/third-level-1
Can anyone spot what I'm doing wrong?? ..
Below is based on code from the French CMSMS forum:
{* this template uses recursion, but not a smarty function. *}
{*
variables:
node: contains the current node.
aclass: is used to build a string containing class names given to the a tag if one is used
liclass: is used to build a string containing class names given to the li tag.
*}
{if !isset($depth)}{$depth=0}{/if}
{strip}
{$caret=''}
{if $depth == 0}
<ul class='nav navbar-nav'>
{else}
<ul class='dropdown-menu' role='menu'>
{/if}
{$depth=$depth+1}
{foreach $nodes as $node}
{* creation and reset classes links and anchors *}
{$liclass=[]}
{$aclass=[]}
{if $depth == 1}{* if you are on the top Parent *}
{$liclass_top_parent[]='dropdown'} {* for top level section header *}
{$liclass[]='not-parent'} {* modify to suit your needed 'not parent' class *}
{$aclass[]='dropdown-toogle'}
{$aclass[]=$node->alias} {* delete if no alias in the class anchor *}
{elseif $node->children_exist}{* if the item has children *}
{$liclass[]='dropdown has-children'}
{$liclass[]='dropdown-submenu'}
{$aclass[]='dropdown'}
{$aclass[]='dropdown-toogle'}
{$aclass[]=$node->alias}{* delete if no alias in the class anchor *}
{else}
{$aclass[]=''}
{/if}
{* build the menu item from the node *}
{if $node->type == 'sectionheader'}
<li class='{implode(' ',$liclass_top_parent)} {if isset($node->children)} q{/if} {if $node->current} active {/if} ' ><a{if count($aclass) > 0} class="{implode(' ',$aclass)}"{/if} a href="#">{$node->menutext}</a>
{if isset($node->children)}
{include file=$smarty.template nodes=$node->children}
{/if}
</li>
{elseif $depth == 1}
<li class="{implode(' ',$liclass)} {if $node->current} active {/if}">
<a{if count($aclass) > 0} class="{implode(' ',$aclass)}"{/if} href="{$node->url}" data-toggle='dropdown' data-target='#' target='_self'>{$node->menutext} {$caret}</a>
{if isset($node->children)}
{include file=$smarty.template nodes=$node->children}
{/if}
</li>
{elseif $node->type == 'separator'}
<li style="list-style-type: none;"><hr class="menu_separator"/></li>
{else}
<li{if count($liclass) > 0} class="{implode(' ',$liclass)} {if $node->current} active {/if}"{/if}>
<a{if count($aclass) > 0} class="{implode(' ',$aclass)}"{/if} href="{$node->url}">{$node->menutext}</a>
{if isset($node->children)}
{include file=$smarty.template nodes=$node->children}
{/if}
</li>
{/if}
{/foreach}
{$depth=$depth-1}
</ul>
{/strip}
[SOLVED] CMSMS 2.0 Navigator, ignoring section-header alias
[SOLVED] CMSMS 2.0 Navigator, ignoring section-header alias
Last edited by KayakMan on Tue Oct 06, 2015 3:48 pm, edited 2 times in total.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: CMSMS 2.0 Navigator, ignoring section-header alias in do
This doesn't have anything to do with your Navigator template as you say that $node->url is already 'incorrect'.
But I suspect this has something to do with your settings.
In "Site Admin >> Settings -- Global Settings" on the "Content Editing Settings" tab do you have "Automatically Create Page URL's" ON. and "Automatically created URL's are flat" ON ?
But I suspect this has something to do with your settings.
In "Site Admin >> Settings -- Global Settings" on the "Content Editing Settings" tab do you have "Automatically Create Page URL's" ON. and "Automatically created URL's are flat" ON ?
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.
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.
Re: CMSMS 2.0 Navigator, ignoring section-header alias in do
Thanks for the reply Calguy !
My settings are:
Automatically create page URL's: Yes
Automatically created URL's are flat: Yes
Page URL's are required: No
I changed 'Page URL's are required:' to yes, cleared cache, but still the same.
P.s I love the way you choose page parents in the 'add content page' navigation tab. Very user friendly!
My settings are:
Automatically create page URL's: Yes
Automatically created URL's are flat: Yes
Page URL's are required: No
I changed 'Page URL's are required:' to yes, cleared cache, but still the same.
P.s I love the way you choose page parents in the 'add content page' navigation tab. Very user friendly!
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: CMSMS 2.0 Navigator, ignoring section-header alias in do
Then that is your problem.
You have page urls, that are created as flat.
You will now need to go through each page, and erase the URL slug. as those settings only effect behaviour when adding or editing content. They do not retroactively edit your content pages for you.
You have page urls, that are created as flat.
You will now need to go through each page, and erase the URL slug. as those settings only effect behaviour when adding or editing content. They do not retroactively edit your content pages for you.
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.
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.
Re: CMSMS 2.0 Navigator, ignoring section-header alias in do
Thanks Calguy !!!!!! that was it.