Make the initial dropdown menu option not go to a page
Permalink
I am building a website that includes a drop down navigation using the Auto Nav.
Right now the navigation looks like this:
--Home
--Schools
--School 1
--School 2
--School 3
Right now when you click on Schools it takes you to a page (which is blank because I haven't added anything)
My question is, how would you make it so Schools didn't go anywhere when clicked and you had to choose from the drop down options?
Right now the navigation looks like this:
--Home
--Schools
--School 1
--School 2
--School 3
Right now when you click on Schools it takes you to a page (which is blank because I haven't added anything)
My question is, how would you make it so Schools didn't go anywhere when clicked and you had to choose from the drop down options?
Can you post the Auto Nav template you are using. My guess is that you would add a page attribute called something like exclude_page_link_nav and then modify the auto nav where it is putting in the link and have it look for the exclude_page_link_nav and not put the url in the nav. If you can post the autonav template you are using I could help you figure it out.
I'm not really sure what you mean, as I am brand new to concrete5 but to get the nav I placed:
insdie my default.php file and then went into edit mode and added the Auto Nav block to my page.
<?php $a = new Area('Header Nav'); $a->setBlockLimit(1); $a->display($c); ?>
insdie my default.php file and then went into edit mode and added the Auto Nav block to my page.
And you have your auto_nav in dropdowns or is it a tree?
Try this, create a file in your root/blocks/autonav/templates folder called no_link.php
in it put
The go to your dashboard -> Pages & Themes -> Attributes page
Add an checkbox attribute that looks like the attached.
The go to Dashboard - > Sitemap, click on the page you want to not have the link and click on Properties. Click the Custom Attributes tab. Scroll all the way down, select Disable Link in Nav, scroll all the way back up and make sure the check box is select next to Disable Link in Nav. Click save and repeat for all the pages you don't want to have a link in the nav.
Then on your page, where you have put the autonav, click on the autonav, select Custom Template, select No Link from the drop down. Click save. Publish the page. Clear your site cache.
in it put
<?php //NOTE: For extra functionality, you can add the following page attributes (via Dashboard -> Pages and Themes -> Attributes): // // 1) Handle: replace_link_with_first_in_nav // Type: Checkbox // Functionality: If a page has this checked, clicking on it in the nav menu will go to its first child (sub-page) instead. // // 2) Handle: exclude_subpages_from_nav // Type: Checkbox // Functionality: If a page has this checked, all of that pages children (sub-pages) will be excluded from the nav menu (but the page itself will be included). // // 3) Handle: disable_link_in_nav // Type: Checkbox // Functionality: If a page has this checked, it will appear in the nav menu but will not be "clickable" (will not link to any page). //
Viewing 15 lines of 216 lines. View entire code block.
The go to your dashboard -> Pages & Themes -> Attributes page
Add an checkbox attribute that looks like the attached.
The go to Dashboard - > Sitemap, click on the page you want to not have the link and click on Properties. Click the Custom Attributes tab. Scroll all the way down, select Disable Link in Nav, scroll all the way back up and make sure the check box is select next to Disable Link in Nav. Click save and repeat for all the pages you don't want to have a link in the nav.
Then on your page, where you have put the autonav, click on the autonav, select Custom Template, select No Link from the drop down. Click save. Publish the page. Clear your site cache.