Joss Posted November 16, 2012 Share Posted November 16, 2012 Hi Is there anyway of generating a placeholder in the page hierarchy? Or do I have to create a blank page? My particular reason is to do with Bootstrap - with the bootstrap navigation, top level parent items that have children will not link to a page. When you hard code, you would normally just put <a href="#">item name</a> which you need to trigger the drop down. However, in the Page structure that creates the menu in Processwire, everything is a page ... or am I missing something? All the best Joss Link to comment Share on other sites More sharing options...
diogo Posted November 16, 2012 Share Posted November 16, 2012 hi! you can still hardcode it before the foreach(). i"m on mobile, so i can't help with a code example. Link to comment Share on other sites More sharing options...
Joss Posted November 16, 2012 Author Share Posted November 16, 2012 Hi Diogo I don't like hardcoding anything in a menu, except perhaps the home button, since that makes site updates difficult. With Bootstrap, I can create a page with nothing in it and use that as a place holder, but seems a touch overkill! Joss Link to comment Share on other sites More sharing options...
WillyC Posted November 16, 2012 Share Posted November 16, 2012 seem.to me you must hard.code or make place holder page? one or othre no? i like you baerd Link to comment Share on other sites More sharing options...
Soma Posted November 16, 2012 Share Posted November 16, 2012 A page is more like a abstract node so it can be virtually anything it may or may not have children. This allows for some great flexibility if you use it to your advantage and maybe use a checkbox or a distinct template to use that in you code to generate the menu. In PW you would simply create a folder and use that as a container for your pages and output it differently. Create a template "folder" and only have the default title field. Use that to create those pages. In your code you can do a check like this pseudo code when outputing a link if($child$child->template = 'folder') { echo "<a class='dropdown-toggle'>$child->title</a>"; // .... loop children code } else { echo "<a href='$child->url' data-target='$child->url'>$child->title</a>"; } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now