Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add %%CURRENT_PAGE%% magic placeholder #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WebFreak001
Copy link

Useful for default page templates (like <catlist %%CURRENT_PAGE%% -noHead -sortAscending -hideNotFoundMsg>)

When a page is created by default nothing will be shown with that catlist. When creating subpages (without moving the original page into the new namespace and renaming it to start) they will be shown on the original page as links automatically.

I'm not sure what the difference between getID() and global $ID is, but I thought it would be better style adding the variable here instead of in the handle function.

Useful for default page templates (like `<catlist %%CURRENT_PAGE%% -noHead -sortAscending -hideNotFoundMsg>`)

When a page is created by default nothing will be shown with that catlist. When creating subpages (without moving the original page into the new namespace and renaming it to start) they will be shown on the original page as links automatically.

I'm not sure what the difference between `getID()` and `global $ID` is, but I thought it would be better style adding the variable here instead of in the `handle` function.
@xif-fr
Copy link
Owner

xif-fr commented Dec 28, 2021

Sorry for the delay.

I'm not sure what's the point of %%CURRENT_PAGE%%.
A page is not a namespace, right ? ($ns = getID()).
And when you say "When creating subpages", I don't really understand because "subpages" does not exist in dokuwiki, only namespaces (folders) and pages (.txt) (startpages being a special type of page, but still).
Could you give a slightly more concrete example ?

@WebFreak001
Copy link
Author

my use-case:
I create regular pages (a.txt, b.txt, c.txt)
eventually I realize I want to add subpages to b, but instead of moving b.txt to b/start.txt I take the lazy approach and just create a new b/subpage.txt - then both a b namespace and b as a page exists sharing the same name and %%CURRENT_PAGE%% would then show the subpages, without needing to add it to b.txt (so you can have it in the empty page template)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants