main nav 5.6 attributes
Permalink Browser Info Environment
I notice that the main navigation template does not take advantage of some of the new attributes (hide children from nav, replace link with first child, etc).
If anyone else wants to use these, you can copy the default to and just add a class of sf-menu to the main ul on line 113.
If anyone else needs the same functionality that should get you going in the right direction.
If anyone else wants to use these, you can copy the default
/concrete/blocks/autonav/view.php
/blocks/autonav/templates/slate_main_nav.php
If anyone else needs the same functionality that should get you going in the right direction.
Type: | Discussion |
---|---|
Status: | New |
Thanks so much for pointing this out. I'll add this to my next update.
Hi triplei,
I tried what I understood from your answer, but it did nto work.
I copied [/concrete/blocks/autonav/view.php] to [/blocks/autonav/templates/slate_main_nav.php].
these are the steps that I took:
- Created sub-folders under blocks [autonav] and [temlpates]
- then copied view.php to that folder [/blocks/autonav/templates/]
- and renamed view.php to slate_main_nav.php
are these steps correct?
another question regarding [nd just add a class of sf-menu to the main ul on line 113.]
when I open main.css I do not see ul on line 113.
excuse my limitations
can you please elaborate?
thanks
SAA
I tried what I understood from your answer, but it did nto work.
I copied [/concrete/blocks/autonav/view.php] to [/blocks/autonav/templates/slate_main_nav.php].
these are the steps that I took:
- Created sub-folders under blocks [autonav] and [temlpates]
- then copied view.php to that folder [/blocks/autonav/templates/]
- and renamed view.php to slate_main_nav.php
are these steps correct?
another question regarding [nd just add a class of sf-menu to the main ul on line 113.]
when I open main.css I do not see ul on line 113.
excuse my limitations
can you please elaborate?
thanks
SAA
Hi andarys,
It sounds like you're most of the way there. The class should be added in the /blocks/autonav/templates/slate_main_nav.php.
If you scroll down most of the way through that file you should see a line that currently is:
if you change that to
it should do the trick.
Hopefully that helps out.
It sounds like you're most of the way there. The class should be added in the /blocks/autonav/templates/slate_main_nav.php.
If you scroll down most of the way through that file you should see a line that currently is:
echo '<ul class="nav">'; //opens the top-level menu
if you change that to
echo '<ul class="nav sf-menu">'; //opens the top-level menu
it should do the trick.
Hopefully that helps out.
Hello Triplei,
thanks for your follow up.
the closest line that I found was around
Lines 32-35
if (!$containsPages) {
// this is the first time we've entered the loop so we print out the UL tag
echo("<ul class=\"nav sf-menu\">");
}
and added the sf-menu to that line; it did not work.
I have attached the the [slate_main_nav.php] file that i made the changes to [had to change the extension to txt for the upload on C5 site].
much appreciated
SAA
thanks for your follow up.
the closest line that I found was around
Lines 32-35
if (!$containsPages) {
// this is the first time we've entered the loop so we print out the UL tag
echo("<ul class=\"nav sf-menu\">");
}
and added the sf-menu to that line; it did not work.
I have attached the the [slate_main_nav.php] file that i made the changes to [had to change the extension to txt for the upload on C5 site].
much appreciated
SAA
Try clearing your site's cache (Dashboard->System & Settings->Clear Cache)
just tried clearing the cache. that did not work ;0(
This file you've attached is the original slate_main_nav.php file. This isnt the one you're supposed to be changing. It's supposed to be the new one you copied to blocks/autonav/templates/slate_main_nav.php.
Just a thought, did you update your site to 5.6 or was it a clean install of 5.6? If you updated to 5.6, copy the view.php file from updates/concrete5.6/concrete/blocks/autonav/view.php and copy it to blocks/autonav/templates/slate_main_nav.php like triplei outlined.
Just a thought, did you update your site to 5.6 or was it a clean install of 5.6? If you updated to 5.6, copy the view.php file from updates/concrete5.6/concrete/blocks/autonav/view.php and copy it to blocks/autonav/templates/slate_main_nav.php like triplei outlined.
Ahha, great catch. it worked, C5 version 5.6.0.1 (upgraded from 5.5);
I edited and copied [updates/concrete5.6.0.1/concrete/blocks/autonav/view.php] to [blocks\autonav\templates\] and rename it the [view.php] file to [slate_main_nav.php]
edited in [slate_main_nav.php] the following lines.
================================================
Scroll down until yo see a line below:
Change this code to the following:
================================================
thanks to you (C5mix) and (TripleI)
SAA
I edited and copied [updates/concrete5.6.0.1/concrete/blocks/autonav/view.php] to [blocks\autonav\templates\] and rename it the [view.php] file to [slate_main_nav.php]
edited in [slate_main_nav.php] the following lines.
================================================
Scroll down until yo see a line below:
echo '<ul class="nav">'; //opens the top-level menu
Change this code to the following:
echo '<ul class="nav sf-menu">'; //opens the top-level menu
================================================
thanks to you (C5mix) and (TripleI)
SAA
Great - glad you got it figured out!