XF 2.1 Navigation from XFMG to a page not working

dds115

Member
Whenever I'm on my XFMG navigation tab, I can not go to a page that I have as a navigation tab.

When I go from my forum (domain.com) to the page (domain.com/pages/producthistory) it works fine. When I'm on my XFMG tab (domain.com/media) and try going to the page navigation tab it puts in the URL "domain.com/media/index.php?pages/producthistory/".

Any way to fix this? Thanks for any help!
 
What have you entered as the link for the tab? Try generating it using the router using something like:
{{ link('pages', {'node_name': 'producthistory'}) }}
 
What have you entered as the link for the tab? Try generating it using the router using something like:
{{ link('pages', {'node_name': 'producthistory'}) }}
That fixed it, thank you.

If you have an extra minute, would you mind explaining that code to me? I'm very new at this so the more I learn vs. copy and paste will help. If not, no problem and I appreciate you solving my issue!
 
Sure. You can use template expressions in this field by surrounding them with double curly braces ({{ ... }}). The link() template function lets you build links using the routing system. You can build links to static pages using something like link('account/preferences'), or to dynamic pages using something like link('pages', $page) (where $page is a page entity). If you don't have an entity to work with, you can pass the required route parameters using an associative array, which are written in the template system using the curly brace syntax {'key': 'value'}.

In this case the pages route requires the node_name parameter, but you don't have a page entity to work with so you just pass it manually instead.
 
Top Bottom