1

I'm using Structure and have a "Supernav" page with multiple children that will make up the supernav for the site. I thought this would be a nice way to have all pages on the site accessible to the client via one location: the Structure UI.

enter image description here

If you visit any of the child pages in the "supernav" group the URL comes out like this:

http://website.com/supernav/prospective-students

I'd love to be able to remove the supernav segment of those URLs so that it ends up being:

http://website.com/prospective-students

I don't even want the supernav segment to appear in the status bar when you hover over these links on the page. Is this possible? With CodeIgniter this comes down to a simple routing rule, but I don't know if that's an option with EE.

Appreciate any help I can get!

2
  • 1
    Just curious why you tagged with Codeigniter when the question doesn't relate to CI other than you know it's capable of doing it? Commented Nov 10, 2012 at 22:52
  • 1
    Well, because EE is built with CI and my hope was that someone with my history (starting in CI and moving to EE) would have figured this out. Commented Nov 11, 2012 at 0:05

2 Answers 2

2

This may be a bit after the fact, but have you considered using NavEE for this sort of situation and replacing Structure wholesale? You can build multiple navigation content, and don't have to "hide" the content. I love Structure, but you would have to use .htaccess in order to get the results you're wanting, as well as some routing stash/embeds.

Sign up to request clarification or add additional context in comments.

2 Comments

This would be what I'd recommend, too (NavEE or Taxonomy). You can use those alongside Structure. Then you just move your supernav pages back up to the root level in structure and keep them as hidden from the Structure nav.
I've used NavEE alongside Structure before in this instance. I'd love to have a lot more control over navigation in Structure. You could of course use Structure Entries as well but your queries will take a HUGE hit.
0

You could use Freebie for this as well.

Take control of your URLs — define segments that you want EE to ignore completely. Use 'freebie' segments to trigger template behavior, build dynamic archives inside Structure, or just build special URLs for analytics purposes. Freebie allows you to use segments in powerful, flexible ways without the hassle of dealing with strict URL parsing (like Structure's).

You just add supernav to the Freebie settings (under Freebie segments) and supernav can then be ignored. If you still need to run a conditional off of supernav, {segment_1}, you can use {freebie_1} instead. Read more about that in the add-ons documentation over at Devot:ee and in this post by it's creator.

With that said, I'm not positive if you can output the nav using normal Structure tags and get it to display all children of supernav without supernav itself still being in the URL. To get around this you would need to hard code your navigation (or use NavEE or Taxonomy.)

I hope someone can verify if Structure has a tag/param, or not, which addresses this issue as I'm not really sure either way.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.