arsava / dokuwiki-template-vector

"vector" brings you the MediaWiki/Wikipedia 2010 look and feel for DokuWiki.
http://www.dokuwiki.org/template:vector
GNU General Public License v2.0
38 stars 9 forks source link

feature request: navigation box depending on current namespace #45

Open ghost opened 9 years ago

ghost commented 9 years ago

I'd like to be able to build the navigation box depending on the current namespace. If the navigation page is specified relative in vector_navigation_location (page name without a namespace, or .:pagename for example), the navigation page should be searched in the current namespace. If there is no navigation page, search parent namespaces up to root --> inherit. This behaviour is similar to https://www.dokuwiki.org/namespace_templates search mechanism.

To prevent this suggested behaviour, simply use an absolute page name like :wiki:navigation by checking if first char is a :.

retostauss commented 9 years ago

I built a local navigation which might be useful for your use case:

// Local navigation depending on the page "local_navigation" in the namespace of the displayed page
$_vector_boxes["example1"]["headline"] = "Local navigation";
$_vector_boxes["example1"]["xhtml"] = tpl_include_page(getNS(cleanID(getID())).":local_navigation", false);