Not logged in. · Lost password · Register
Forum: General Help and Support Development RSS
How does one trigger a page save action, on the click of a button
I want to have a simple 1// submit button, which when clicked 2// creates a 'example.txt' file, with the contents 'hello world'
Avatar
abrar #1
Member for 3 months · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: How does one trigger a page save action, on the click of a button
Sorry folks if the answer to this question is straightforward, but I am unable, for the life of me, find anything out there on the internet that answers this question of mine.

i have been using dokuwiki for a few months now, mostly hacking my say around. To achieve what i want, which is:
on the click of a custom button made by me, create a new 'example.txt' page, and fill it up with the content: hello world.

I've been reading about events and action plugins, but they mostly seem to talk about 'doings some actions when a DOKUWIKI event is triggered', but no where can I find, how to create a custom button, or any other input, that triggers an existing dokuwiki event. I really need to have a button that triggers the 'page save' event, and creates the 'example.txt' file.

Please could someone help me out with this?

Apologies if this is a silly question.

Best,
Abrar
Avatar
StarArmy #2
Member since Nov 2011 · 74 posts
Group memberships: Members
Show profile · Link to this post
Well, you could use the bureaucracy plugin to create new pages with one click. You would first create a form, and a template for the form fields to be used in...once those are set up, users can enter their information in a form and then click to create a new wiki page using the information they entered.

On my wiki, which is used for a roleplaying game, I have a form for creating a character. Users select options for their character and enter things like their character name, and when they click submit, the plugin creates a complete character page for them.
Avatar
turnermm (Moderator) #3
Member since Oct 2009 · 4598 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
In reply to post #1
Look at the addnewpage plugin.  It says it has not been updated recently, but it still works quite well.  You could put the plugin markup in a sidebar or use the site template technique and place it in your template:
<?php echo p_render('xhtml',p_get_instructions('{{NEWPAGE}}'),$info) ?>
See:
https://www.dokuwiki.org/plugin:addnewpage#site_templates
The latter works well in the footer (footer.php in the dokuwiki template);

The plugin is very simple to  install and use.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
This post was edited on 2019-04-15, 17:36 by turnermm.
Avatar
abrar #4
Member for 3 months · 2 posts
Group memberships: Members
Show profile · Link to this post
Thanks @turnermm & @StarArmy.

However, I have used the bureaucracy plugin, and I just checked out the addnewpage plugin right now. My requirement is a bit different.

So, I am creating quite a customized form with rich text editing, (which is why i cannot use bureaucracy). Anyway, so I need a button at the end of this form, much like bureaucracy, that allows me to export all the content entered into that form as a page...

Hence I felt, that maybe creating a button, that triggers the save page event might be my best option...

Any ideas??
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-04-20, 00:40:34 (UTC +02:00)