Closed GitWonder closed 4 weeks ago
If I understand correctly what you say, I think that just <nspages>
should be what you are looking for.
Does that answer you qyestion? If it does not, please let me know what I misunderstood.
I am building a wiki for handover to a client. All the plugins I am using need to be as generic in their execution as possible.
If I have docs namespace containing process namespace containing process 1 page and hr processes namespace `[docs] docs.txt
|- [processes]
|- process.txt
|--- [hr_processes]
|--- hr_processes.txt
|----- hr_process_1.txt`
(GitHub code blocks are not the best diagramming method sorry)
What I need is if I were to place the code in the top level docs it would correctly show the index of everything from root down, but if I were to paste the same code to [hr_processes] it would show the index for everything in hr_processes only.
All the other plug-ins I've looked at require the namespace to be specifically declared which is causing me a lot of pain while structure is being finalised - movePage doesn't properly interact and the second issue is that I can't just place the code in a template and let the user create their page within a scaffold of genericised statements.
If I understand correctly your example, just putting <nspages>
on your page should do what you want:
<nspages>
on a top levels docs it would show the index of everything in the root<nspages>
, without option) on hr_processes
it would show pages in in the hr_processes
namespace only (because when no namespace is provided, this plugin consider we're interested in the current one)Does that fit your needs?
Yes that is exactly what I am looking for.
EDIT I think I misunderstand where the start page for a namespace is meant to reside. Should the start page be IN the namespace our outside the namespace? END EDIT
I think there is something wrong with my Dokuwiki setup then because if I place
I'm not sure I understand the behavior you describe. Could you reproduce the issue on a public instance of dokuwiki and send me the url so I could see it for myself?
I'm noticing that I missed your edition, and it's possible that this is the explanation of this behavior. My understanding is that:
Dokuwiki considers that there are 2 possible options for the location of the main page of a namespace. Namely, the main page of the namespace :hr_processes
may be either:
:hr_processes:start
:hr_processes
However nspages does not implement the exact same logic: it considers that:
:hr_processes:start
is part of the namespace :hr_processes:
:hr_processes
is not part of it (it considers that it is part of the parent namespace)I'm not too sure if that's a bug in nspages or if it's a bug in a Dokuwiki API used by ns pages (and I'm not sure I'll have time to figure it out any time soon, so I guess I'll leave this bug report open for now). Anyway, it seems that in your wiki you have :hr_processes
, and a solution would be to move this page to :hr_processes:start
instead.
This should be fixed by the last version, as you can now use <nspages ~>
on your page and it should lead to the required behavior (ie: considering that the current page represents the sub-namespace you're interested in)
Is there a way to compile a list of pages for this namespace in a generic way, i.e. <nspages .:> or <nspages @currentNS> rather than explicitly name the namespace? This would enable me to more freely move and rename pages and namespaces and also template the format.