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

Query: Possible to customise the "Add page" button label #108

Closed
Whyglobaleyes opened this issue Nov 9, 2024 · 1 comment · Fixed by #109
Closed

Query: Possible to customise the "Add page" button label #108

Whyglobaleyes opened this issue Nov 9, 2024 · 1 comment · Fixed by #109

Comments

@Whyglobaleyes
Copy link

Hello Everyone,

Is there any possibility of over-riding the text shown on the Add Page button please.

I intend to have a few buttons on the same page allowing me to quickly create new pages in different namespaces/ with different templates.

  • With the current code I've got two buttons on the page that look identical:
  {{NEWPAGE>journal:%Y.%m.%d?autopage}}
  {{NEWPAGE>log:%Y.%m.%d?autopage}}
  • What I'd like is something along the lines of:
  {{NEWPAGE>journal:%Y.%m.%d?autopage?label=New_Journal_Page}}
  {{NEWPAGE>log:%Y.%m.%d?autopage?label=New_Log_Page}}

Is this already a thing, is there a work around I can do or would this be a feature request please?
Thanks in advance.

@dregad
Copy link
Owner

dregad commented Nov 9, 2024

It is currently not possible to customize the button's label, it is defined as a localized string:

$lang['okbutton'] = "Add page";

You could change the label in your language file(s), but it would apply to all NEWPAGE forms so that's not what you want.

It should not be too difficult to enable custom labels as you suggest.

dregad added a commit that referenced this issue Nov 10, 2024
By specifying `{{NEWPAGE?label=xxxx}}`, it is now possible to set a
custom label on the Add New Page form's submit button, instead of using
the `Add page` default.

The specified value for the *label* parameter is a DokuWiki language
string, allowing localization; if no matching translation is found, then
`xxxx` will be displayed as-is.

Fixes #108
@dregad dregad closed this as completed in 2c27907 Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants