Not logged in. · Lost password · Register
Forum: General Help and Support Features and Functionality RSS
Insert content dynamically
by clicking buttons on the page
Avatar
3AtÜ #1
Member since Mar 2007 · 29 posts
Group memberships: Members
Show profile · Link to this post
Subject: Insert content dynamically
Hi,
since I've done several small hacks to dokuwiki and (thanks to the excellent documentation) understand more and more code, I'd like to go one step further:
Before I start, I want to ask around, if I'm on the right way.

1) Is it possible to change parts of a page only by clicking on a button?
2) Where should I go? Using something existing (command plugin) or create something from the scratch?
2) Can I recycle that code later to use Ajax functionality?

Why that?
I have a site of a choir (15 members). The choirmaster wants to manage their gigs: members should sign up for every event so that he can plan them.  I thought, it would be nice, if the gigs were shown in tables or lists, and logged in members only have to click on a button to add there name to an event or to reject. Ajax functionality would be cool, but I'm far from that  :-D

Thank you.
Avatar
Wolfgang_F. #2
Member since Jul 2007 · 24 posts
Group memberships: Members
Show profile · Link to this post
Hi
I don't know if it really matches your problem - but if you just use the Signature-Button, the username will be appended to the end of the edited page. But that way you have to make a page for each gig ... and it has no reject-option ...
chi #3
Member since Jun 2006 · 1851 posts · Location: Munich Germany
Group memberships: Members, Super Mods, Wiki Managers
Show profile · Link to this post
In reply to post #1
Quote by 3AtÜ:
1) Is it possible to change parts of a page only by clicking on a button?

Generally speaking, yes ;-)! You could for example call a custom action plugin which modifies a page if a certain action gets triggered by your button.

Quote by 3AtÜ:
2) Where should I go? Using something existing (command plugin) or create something from the scratch?

OTOH I don`t know a plugin which does something similar. AFAIK the poll plugin uses a action plugin to store poll votes in a separate meta data file. Maybe that gives you some ideas.

Quote by 3AtÜ:
2) Can I recycle that code later to use Ajax functionality?

Yes, if the plugin which shows the output relies on page metadata rather than on the page content itself. The poll plugin does something like that but without AJAX (it reloads the page after someone voted). If you want to rely on AJAX you don`t need an action plugin, a syntax plugin would be enough. The "button" of your plugin would trigger an AJAX action which would update a custom meta data file and then reload/re-render a certain part of your page. However, doing what you want without AJAX is a lot easier to implement.
Please add [SOLVED] to the initial thread subject if you feel your question has been answered.
If my answer doesn't make sense maybe your question didn't either - just visit http://facepalm.org.
Avatar
3AtÜ #4
Member since Mar 2007 · 29 posts
Group memberships: Members
Show profile · Link to this post
Thank you. But instead of writing to metadata, it should write directly into the page, so that it still stays editable by hand.

@wolfgang: You know: My users are almost over 30, they would be scared by seeing any dokuwiki syntax  :-p

@chi: If I understand you right, the most suitable opportunity would be, to implement an action plugin that generates the buttons (with ids). That plugin could open the file by hand (not so snifty) or maybe use some functions to open a page and pasting content (paying attention to page locks)

Okay, I'll give it a try.
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-11-12, 05:52:28 (UTC +01:00)