plugin:searchformgoto
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
plugin:searchformgoto [2020-06-06 18:01] – ics-informatique | plugin:searchformgoto [2023-05-30 18:55] (current) – removed nerun | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== SearchFormGoTo Plugin ====== | ||
- | |||
- | ---- plugin ---- | ||
- | description: | ||
- | author | ||
- | email : payton <at> foolord <dot> com | ||
- | type : action | ||
- | lastupdate : 2014-01-04 | ||
- | compatible : " | ||
- | depends | ||
- | conflicts | ||
- | similar | ||
- | tags : search, redirect | ||
- | downloadurl: | ||
- | ---- | ||
- | |||
- | ^ Download | [[http:// | ||
- | |||
- | ===== How to use ===== | ||
- | |||
- | |||
- | |||
- | You have to modify your template to use this plugin. | ||
- | |||
- | <code php> | ||
- | <?php tpl_searchform() ?> | ||
- | </ | ||
- | |||
- | With: | ||
- | |||
- | <code php> | ||
- | <?php if (!plugin_isdisabled(' | ||
- | $searchformgoto = & | ||
- | $searchformgoto-> | ||
- | } else { tpl_searchform(); | ||
- | ?> | ||
- | </ | ||
- | |||
- | ===== Download and Installation ===== | ||
- | |||
- | Search and install the plugin using the [[plugin: | ||
- | |||
- | * < | ||
- | * http:// | ||
- | |||
- | |||
- | ===== Change log ===== | ||
- | |||
- | * danny0838' | ||
- | |||
- | |||
- | ===== Discussion ===== | ||
- | |||
- | ---- | ||
- | ** As of right now this doesn' | ||
- | < | ||
- | Fatal error: Call to undefined function tpl_gotoform() | ||
- | </ | ||
- | |||
- | > I can't do it, not call tpl_gotoform with plugin installed | ||
- | > Is there other TODO ? | ||
- | |||
- | >> I'm not sure I understand your problem. | ||
- | |||
- | ---- | ||
- | |||
- | |||
- | > I'd love to use this plugin, but the template I'm using (Monobook) uses a different piece of script for the search bar. I'm comfortable enough with searching and replacing lines of code when necessary, but I'm a newbie and *adapting* code is a little beyond me. Is there any way to turn the following searchform code into something that also works with your plugin? | ||
- | |||
- | <code php> | ||
- | > <?php if (tpl_getConf(' | ||
- | ><div id=" | ||
- | > <h5> | ||
- | > < | ||
- | > <div class=" | ||
- | > <form action="<? | ||
- | > <input type=" | ||
- | > <input id=" | ||
- | > <input type=' | ||
- | > <input type=' | ||
- | > </ | ||
- | > </ | ||
- | ></ | ||
- | </ | ||
- | |||
- | >Sorry if this is a dumb question. Thanks in advance! | ||
- | >Alan Gratz | ||
- | |||
- | >> Hm. It looks like that template defines its own search form entirely. | ||
- | >> 1. Replace **all** of the above code within the <div> tags with ' | ||
- | >> 2. [This one might be better] Add the following lines near the end of your template form (you may need to remove the hidden " | ||
- | < | ||
- | <input type=" | ||
- | <input type=" | ||
- | <input type=" | ||
- | </ | ||
- | -Payton | ||
- | |||
- | ---- | ||
- | Unfortunately, | ||
- | |||
- | Thanks,\\ | ||
- | Kingsley | ||
- | |||
- | |||
- | For the issue of **undefined function tpl_gotoform** a little patch could be done: | ||
- | |||
- | * Delete line 35, and 38-63 in action.php: | ||
- | |||
- | <code php line-35> | ||
- | $contr-> | ||
- | </ | ||
- | |||
- | <code php line-38-63> | ||
- | function handle_act_render(& | ||
- | ... | ||
- | } | ||
- | </ | ||
- | |||
- | * Add a file helper.php: | ||
- | |||
- | <code php helper.php> | ||
- | <?php | ||
- | /** | ||
- | * Searchformgoto Plugin | ||
- | * | ||
- | * @license | ||
- | * @author | ||
- | */ | ||
- | |||
- | // must be run within Dokuwiki | ||
- | if(!defined(' | ||
- | |||
- | class helper_plugin_searchformgoto extends DokuWiki_Plugin { | ||
- | |||
- | function gotoform($ajax=true, | ||
- | global $lang; | ||
- | global $ACT; | ||
- | global $ID; | ||
- | // don't print the search form if search action has been disabled | ||
- | if (!actionOk(' | ||
- | |||
- | print '< | ||
- | print '< | ||
- | print '< | ||
- | print '< | ||
- | if($ACT == ' | ||
- | if(!$autocomplete) print ' | ||
- | print ' | ||
- | print '< | ||
- | print '< | ||
- | if($ajax) print '< | ||
- | print '</ | ||
- | return true; | ||
- | } | ||
- | } | ||
- | </ | ||
- | |||
- | * Write this in the template where you want to display the search box (commonly replace tpl_searchform()): | ||
- | |||
- | <code php> | ||
- | <?php if (!plugin_isdisabled(' | ||
- | $searchformgoto = & | ||
- | $searchformgoto-> | ||
- | } else { tpl_searchform(); | ||
- | ?> | ||
- | </ | ||
- | |||
- | --- danny0838 // | ||
- | |||
- | |||
- | thanks danny0838!!! | ||
- | --- [[user> | ||
plugin/searchformgoto.1591459292.txt.gz · Last modified: 2020-06-06 18:01 by ics-informatique