Making a placeholder menu item


A lot of people like to make a nice menu in their websites, but do not want the top level to work as part of that menu, just the drop down areas. Kind of like having the top level of the menu just be titles. There are two ways to achieve this and both are very easy.

Joe made some very easy to use Javascript which will make the top level (or any level actually) a placehold page. Just copy the Javascript below:

/* Instructions - Please Read

This snippet will allow you to disable a page's menu item from linking to the page. This is great if you want a page to act as a placeholder in the     menu, forcing visitors to navigate to a sub-page under it.

1. Insert this snippet in the Javascript tab in RapidWeaver's Page Inspector. 

// Insert this snippet in the Javascript tab in RapidWeaver's Page Inspector.
// You will need to modify the nav link list in the code below 
// to contain the name of the pages that you want to disable.
document.addEventListener("DOMContentLoaded",function(event) {

// Add your Navigation titles to this list
var nav_titles = ['Page 1','Page 2','Page 3','Page 4'];

// ------------------------------------------
// Do not modify below this line
var links = document.querySelectorAll('ul li a');
for (var i = 0; i < links.length; i++) {
    if (nav_titles.indexOf(links[i].textContent) >= 0) links[i].href = 'javascript:void(0)';
}

});

Now you need to change a piece of the code:

var nav_titles = ['Page 1','Page 2','Page 3','Page 4'];

You will need to change the Page 1, Page 2, Page 3 and Page 4 in the code to the name of the pages you want to not work in the navigation. If you have less than 4 pages, just delete the extras, if you have more, add them.