Not logged in. · Lost password · Register
Forum: General Help and Support Plugins RSS
Adding a Print button
Avatar
Schopf #1
User title: Schopf
Member for 2 months · 2 posts · Location: Brazil
Group memberships: Members
Show profile · Link to this post
Subject: Adding a Print button
I would like to create a Print button in action menu. I have found this article but its not updated: https://www.dokuwiki.org/tips:printview. I couldnt do anything with it.

I just need to call the browser's print function. Its not necessary to use any Dokuwiki internal function. As I said, I need call the browser's print function using a Print button in action menu, just that.

Is there a plugin for that or an easy way to do it? I dont care in hack the code to get it working.
This post was edited on 2019-08-04, 00:29 by Schopf.
Avatar
turnermm (Moderator) #2
Member since Oct 2009 · 4711 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
These give instructions for accessing the browser's print function:
https://stackoverflow.com/questions/28580383/print-a-docum…
http://www.javascriptkit.com/howto/newtech2.shtml
You can place these buttons in your template.

I haven't tested these but they should get you on your way.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
Schopf #3
User title: Schopf
Member for 2 months · 2 posts · Location: Brazil
Group memberships: Members
Show profile · Link to this post
Thank you for reply this post.

I think second link will solve my problem but I dont know how to create an action menu icon in dokuwiki.

Is there some documentation about it?
Avatar
turnermm (Moderator) #4
Member since Oct 2009 · 4711 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
This is the documentation that you will need for the current (new) menu system:
https://www.patreon.com/posts/menus-14160215
https://www.dokuwiki.org/devel:menus
https://www.dokuwiki.org/devel:event:menu_items_assembly

For a concrete example, download my plugin tplmod: https://github.com/turnermm/tplmod/, which uses this system for a sidebar toggle.  Look at the file MenuItem.php, and in action.php see the function addsvgbutton.  This is the new menu system.  In action.php there is also the function action_link which is called using the old menu event TEMPLATE_SITETOOLS_DISPLAY.  You can simply cannibalize these functions for your own use.  You'll find more examples in my dwedit plugin.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
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-10-16, 20:22:56 (UTC +02:00)