ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

structure module - Custom lniks?

October 20, 2009 2:39pm

Subscribe [3]
  • #1 / Oct 20, 2009 2:39pm

    zork

    11 posts

    I am using the structure module, which works great within my site.

    {exp:structure:nav_sub start_from="/about-us" limit_depth="2"}

    However I need one of my nav buttons to link outside of my site. “http://www.somewhere-else.com”

    Can this be achieved using structure?

  • #2 / Oct 20, 2009 2:50pm

    Focus Lab Dev Team

    1129 posts

    I’m guessing you’re trying to add an additional <li> element within the nav_sub created unordered list.

    If so, it is not currently a feature in Structure. I added some code to Structure to do this exact thing for a client site and it worked very well. There are a few ways you could do this.

    If you want the external link to be at the front or back of your list and the first and last <li> elements do not need specific styling then you could just add your link in its own unordered list right before or after your {exp:structure:nav_sub} tag.

    You could also create a specific template just for that page and have the template have no code other than a redirect. A weird solution but it should work fine.

    That said, I think this might be an “out of the box” feature with the next version of Structure.

  • #3 / Oct 20, 2009 2:53pm

    rockthenroll

    485 posts

    @zork The next version will have include_ul=“yes/no” so you can not output the wrapping ul and add custom links. Erik’s suggestion of a template with a redirect is a good option as well.

  • #4 / Oct 20, 2009 5:29pm

    zork

    11 posts

    I have to say thanks for structure.  It’s really nice.

    Yes did think of those two solutions. For now I can get by. Most likely hard coding my <li> and formatting it with css.

    In the future, what about incorporating some code involving the “Structure URI” field?  or maybe have an “External URI”?

  • #5 / Oct 20, 2009 6:52pm

    rockthenroll

    485 posts

    @zork Glad you’ve got it working. I would like to include something like this down the road, but I’m apprehensive in it’s implementation and keeping things streamlined. Maybe someday!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases