ButonLink
Questions answered by this recipe
How can I Link another Page using a Gui button?
Answer
(:zapform:) (:input submit button "Home" value="Pmwiki HomePage":) (:zap if1="equal '{button}' 'Home' ? nextpage=Pmwiki/Pmwiki":) (:zapend:)
The Code Above Will Link to Pmwiki's HomePage.
Other Applications
(:zapform:) (:input submit button "Proyects" value="Proyects":) \ (:input submit button "Products" value="Products":) \ (:input submit button "PO" value="PO":) \ (:zap if1="equal '{button}' 'Proyects' ? nextpage={$FullName}?action=proy":) (:zap if2="equal '{button}' 'Products' ? nextpage={$FullName}?action=Prod":) (:zap if3="equal '{button}' 'PO' ? nextpage={$FullName}?action=PO":) (:zapend:)
The Above code displays 3 buttons that link to the same page but with different refence of action page. So for Proyect we will be Linking to the same page but with page Action = proy.
Then one can use, let's say in a groupfooter for this page or group, some code to take a decition based in the buton choice or page action selected like below:
(:if equal {$action} proy:) This the Code for handling proyect Sections. (:ifend:)
Release Notes
See Also
- ZAP
- Zap Support Page
- See WikiShExamples#ButtonLink for these 2 examples (above) expressed "in wikish"
- The second example could also be accomplished without redirection using HttpVariables
- The second example could also be accomplished without redirection using ProcessForm
Contributors
Please help to Maintain this receipe specially with the english writing. Let me know if this has been helpful.
Comments
See discussion at ButonLink-Talk
User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.