moby007
I m trying to use custom buttons for wiki action (ie. edit, revisions, ...). I already positioned them at the upper right side of the page and used "display:fixed" to have them always present while scrolling. To save space i want them written vertical and for this i want to use images. Does anyone have a clue how i can replace the buttons with images without printing the values "edit, revisions, ..."? Or should i use tpl_actionlinks? :)
merlin
You can use http BUTTON tag, inside that tag you can use any html code and the whole piece of code became the button.
For example, <form class="button" method="get" action="/dokuwiki/"><div class="no"><input type="hidden" name="do" value="recent" /><button type="submit" onclick="this.form.submit();" accesskey="r"><img src="recent.png" width="50" height="200" title="recent changes [ALT+R]" /></button></div></form> is a submit button.
Another way (I personally don't like this) is to replace input type="submit" with type="image". Such input looks exactly like ordinary IMG tag, has same attributes, and works like clickable button. It submits a form and sends also relative coordinates of mouse cursor from top-left edges of an image, like this: x=10&y=24.
Example:
<form class="button" method="get" action="/dokuwiki/"><div class="no"><input type="hidden" name="do" value="recent" /><input type="image" src="recent.png" height="200" width="50" alt="recent changes" class="button" accesskey="r" title="recent changes [ALT+R]" /></div></form>
The submission will be similar to: /dokuwiki/?do=recent&x=15&y=34
DokuWiki will ignore that x and y and will do a 'recent' action.
This is a guideline, what you cat try :)
Also you may want in look inc/template.php, how tpl_button implemented, and re-implement that code with your own button design (to generate html code like above). Then use reimplemented function.
Sorry if too unclear :)
chi
I think the most straight forward way would be to use html_btn() provided by inc/html.php. Alternatively you could also use the methods provided by inc/form.php - but again - I think html_btn() would be the easier/better solution.
moby007
Thx for your answers, but i was more or less looking for a simple css solution and wasnt sure if i missed anything (I found no way of addressing the buttons through css)!
I still want to stick to css because of accessibility reasons and will build the forms myself. If possible i will supply my solution as plugin, but is it even possible to access plugins through the template (main.php)?
... ah maybe a dirty template hack will be far easier, i ll post my crappy code later. It will consist of phpselfs and fetching "post" and "get" variables :)