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
/concrete/blocks/autonav/view.php
to
/blocks/autonav/templates/slate_main_nav.php
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.

Type: Discussion
Status: New
triplei
View Replies:
c5mix replied on at Permalink Reply
c5mix
Thanks so much for pointing this out. I'll add this to my next update.
andarys replied on at Permalink Reply
andarys
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
triplei replied on at Permalink Reply
triplei
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:
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.
andarys replied on at Permalink Reply 1 Attachment
andarys
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
c5mix replied on at Permalink Reply
c5mix
Try clearing your site's cache (Dashboard->System & Settings->Clear Cache)
andarys replied on at Permalink Reply
andarys
just tried clearing the cache. that did not work ;0(
c5mix replied on at Permalink Reply
c5mix
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.
andarys replied on at Permalink Reply
andarys
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:
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
c5mix replied on at Permalink Reply
c5mix
Great - glad you got it figured out!

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.