DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:searchformgoto

This is an old revision of the document!


searchformgoto plugin

Compatible with DokuWiki

>= 2006-04-25

plugin A plugin for DokuWiki which allows adding a "Go" button to the search form that will go directly to a page if the search exactly matches a page name. Otherwise operates as a normal search.

Last updated on
2009-03-02
Provides
Action

The missing download url means that this extension cannot be installed via the Extension Manager. Please see Publishing a Plugin on dokuwiki.org. Recommended are public repository hosts like GitHub, GitLab or Bitbucket.

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to singlesearchresult

Tagged with goto, redirect, search

How to use

As of right now this doesn't work with a fresh install?

Fatal error: Call to undefined function tpl_gotoform()

You have to modify your template to use this plugin. Edit <dokuwiki home>/lib/tpl/<your template>/main.php and replace the line:

<?php tpl_searchform() ?>

With:

<?php if (!plugin_isdisabled('searchformgoto')) { tpl_gotoform(); } else { tpl_searchform(); } ?>

I can't do it, not call tpl_gotoform with plugin installed
Is there other TODO ?
I'm not sure I understand your problem. It works fine in the installs I've done. Can you describe your issue in more detail? -Payton

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?
<?php if (tpl_getConf('mb_use_search')) { ?>
<div id=“p-search” class=“portlet”>
<h5>
<label><?php echo $lang['monobook_bar_search']?></label></h5>
<div class=“pBody”>
<form action=“<?php echo DOKU_BASE.DOKU_SCRIPT;?>” accept-charset=“utf-8” id=“dwsearch” name=“search”> > <input type=“hidden” name=“do” value=“search” /> > <input id=“qsearchin” name=“id” type=“text” accesskey=“f” value=“” />
<input type='button' class=“searchButton” id=“searchGoButton” value=“<?php echo >$lang['monobook_btn_go']?>” onclick=“document.location.href='<?php echo DOKU_BASE.DOKU_SCRIPT;?>?id=' + >document.search.qsearch__in.value;” />&nbsp;
<input type='submit' name=“fulltext” class=“searchButton” value=“<?php echo >$lang['monobook_btn_search']?>” />
</form>
</div>
</div>
Sorry if this is a dumb question. Thanks in advance!
Alan Gratz
Hm. It looks like that template defines its own search form entirely. I'm not entirely sure what that template is doing with the form, but here's two suggestions to try:
1. Replace all of the above code within the <div> tags with 'tpl_gotoform();'
2. [This one might be better] Add the following lines near the end of your template form (you may need to remove the hidden “do” input you already have):
         
<input type="hidden" name="do" value="goto" />
<input type="hidden" name="current_ns" value="'.$ns.'" />
<input type="submit" value="'.$lang['btn_go'].'" class="button" name="goto" title="'.$lang['btn_go'].'" />

-Payton


Unfortunately, I get “undefined function tpl_gotoform” with the “simple” template.

Thanks,
Kingsley

Download and Installation

Download and install the plugin using the Plugin Manager using the following URL. Refer to Plugins on how to install plugins manually.

plugin/searchformgoto.1246915928.txt.gz · Last modified: 2009-07-06 23:32 by 74.220.244.245

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki