Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

Adding an app to the navigation

edited February 2013 in Apps

What's the best way to add an app to the front-end navigation? Is it to create a page and then include the app as a dynamic object on that page?

Comments

  • edited February 2013

    I generally create a page (so you can use it in the drag and drop navigation building), and then use a "redirect" dynamic object (I beleive there are two, a conditional redirect and a normal redirect) to redirect to the app path.

  • Thank you. I tried both, and the normal redirect works as I hoped. I couldn't figure out what the conditional redirect was doing. (It didn't seem to do anything).

  • This brings up another question: How to get 'class="current"' in the sectional navigation for the app.

    navigation/handlers/section.php has this code:

        if ($item->attr->id == $page->id) {                                                              
            printf ('<li class="current"><a href="/%s">%s</a></li>', $item->attr->id, $item->data);      
        } else {                                                                                         
            printf ('<li><a href="/%s">%s</a></li>', $item->attr->id, $item->data);                      
        }                                                                                                
    

    But now that I've redirected to the app I've lost the $page->id, so nothing is marked current.

  • If you want to keep the page ID, there are two ways you can do it.

    The first is to make your handler embeddable through the Dynamic Objects menu. Then instead of redirecting to it, you would embed it into the page.

    The other way is to set the $page->id in the handler to the ID of the page you want to associate it with. When the navigation renders in the layout template, the handler would have already been called and the navigation handlers will use the correct page ID that you've set.

  • I picked up the idea some where that redirecting might not be ideal for SEO, since it would mean that the site was constantly linking to a 301 page. So from that point of view embedding might be better.

  • OK, I made it embeddable. Previously I was using $this->params to know which listings to show; that didn't work any more but $this->data["embeddable_param"] does.

Sign In or Register to comment.