[Home]WikiPatches/SearchAndEditTags

UseModWiki | WikiPatches | RecentChanges | Preferences

Search and Edit tags for UseMod

Short description

You can put <edit> or <search> anywhere in the text and it will become an edit link or the search form. Of course multiple tags of the same sort can be placed (e.g. an upper and a lower search form).

I added <upload>- and <prefs>-ability for convenience. --UdoGŁngerich, 2005-08-24

How to apply

Instead of:

  $TableOfContents? ||= "";
  $pageText =~ s//$TableOfContents?/gi;

on lines 1615 and 1616 (in my debian 1.0.6 version of UseMod anyway) write:

    $TableOfContents? ||= "";
    # To be able to put the search form in any location...
    my $SearchForm? = q( <div id="search"> ) .
        &GetFormStart .
        &GetSearchForm .
        $q->endform .
        q( </div> );
    my $EditLink?  = &GetEditLink($Id, T('Edit'));
    my $UploadLink?  = &GetUploadLink?($Id, T('Upload'));
    my $PrefLink?  = &GetPrefsLink?($Id, T('Preferences'));
    $pageText =~ s//$TableOfContents?/gi;
    $pageText =~ s/<search>/$SearchForm?/gi;
    $pageText =~ s/<edit>/$EditLink?/gi;
    $pageText =~ s/<upload>/$UploadLink?/gi;
    $pageText =~ s/<prefs>/$PrefLink?/gi;

However, there is some issue with the preview sometimes not saving but searching for '' when hitting the Save button, I already fixed that and will write it down here as soon as I found the bit again.

Thanks for your patience, --UdoGŁngerich, 2005-08-22

Uhm, I think to remember now that the "fix" was to enable the search-button again. If anyone can think of a slightly better solution, I am grateful audience ;) --UdoGŁngerich, 2005-08-24

UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited September 2, 2007 4:59 pm by MarkusLude (diff)
Search: