Limit the menu generation to a namespace

Issue #12 new
D. C. Stoyanov repo owner created an issue

From a request:

I really like this type of menu. Would it be possible to limit the menu generation to a namespace? for example by making <acmenu ns:ns1>; so it would be possible to refine the sidebar display, and to display the tree structure of a namespace even when we are in another namespace.

Comments (6)

  1. D. C. Stoyanov reporter

    Referring to https://www.dokuwiki.org/plugin:acmenu#Examples, I've created three sidebar.txt file.

    When you are in the root namespace you can navigate through all its sub-namespaces, that is branch-a and branch-b. Suppose now to open any page in the namespace branch-*, then you will see only its menu. Remember to add a back link.

    I hope I got right what you are asking for.

  2. D. C. Stoyanov reporter

    From the OP:

    Not really this… Maybe better with a real example, it is hard to explain :) I had a wiki and I had create navigation with namespace and tag in the namespace fr:tag:start . When I am on the root of wiki, I want a sidebar who show only tree structure of fr:tag:. I can't use hidepage for other pages on fr: because… there are a lot and it is useful to see them by other way. So, actually, if I add <acmenu> in my root sidebar, it display more than I want to show.

  3. D. C. Stoyanov reporter

    Maybe I have understand: when you are in fr: you want to see the content of fr:tag:.

    If so, this is beyond the main aim of this plugin but it can be obtained using AcMenu with Include.

    This means that in fr:sidebar you will use: {{page>fr:tag:sidebar&nofooter&noeditbutton}}

    Unfortunately they don't work as I would expect because, from a rapid test, AcMenu still shows all namescpaces and their pages and not only the namespace required (in your case only fr:tag:).

    I will try to fix this behaviour, if possible.

  4. D. C. Stoyanov reporter

    The problem is in _get_base() in syntax.php because $path = $INFO["filepath"]; returns the path of the main page and not the path of the sidebar. Unluckily it seems to be not possible to retrieve the id of the page in which the Lexer has found the pattern <acmenu>, I mean there is no event that returns such information.

  5. Log in to comment