Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Free Nodelet Hack: Mini Super Search

by jdporter (Paladin)
on May 21, 2007 at 14:47 UTC ( [id://616580]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Super Search discouraged?
in thread Super Search discouraged?

In response to a suggestion that there should be a Super Search nodelet, I offer the following: a customizable mini-SuperSearch form for your Free Nodelet.

This is just an example. You can (and should) decide for yourself which fields you want to hard-code (using inputs of type hidden), and which fields you want to let yourself enter values for. (The remainder will get their defaults as defined by Super Search.)

<form method="post" action="?" enctype="application/x-www-form-urlencoded"> <input type="hidden" name="node" value="3989" /> Author:<input type="text" name="a" size=20 value="`author_title`"/><!- +-"--> <br/> Title:<input type="text" name="HIT" size=20 value="`title`"/><!--"--> Sep:<input type="text" name="HIS" size=2 value=" " /> <br/> Search only in/under `root_type_title`: <input name="`root_ss_type`" value="1" type="checkbox"> <br/> Replies: <input name="re" value="A" type="radio" /> All <input name="re" value="S" type="radio" checked="checked" /> Section <input name="re" value="N" type="radio" /> None <br/> <input type="submit" name="go" value="Search" /> </form>

This is pretty cool, because it uses Free Nodelet macros to determine the type of the current thread's root node (replies are simply type 'note', regardless of section) . The mini Super Search form is pre-loaded with that and other relevant values from the current node: the author and the title. You can delete/edit these values as you like before clicking the submit button. If you decide you need more flexibility than this (or than you can hack in your Free Nodelet), then... you know where to find it. :-)

For extra coolness, use the Fake a Nodelet technique to make your Mini Super Search look like a genuine nodelet!

A word spoken in Mind will reach its own level, in the objective world, by its own weight

Replies are listed 'Best First'.
Free Nodelet Hack: Fake A Nodelet
by jdporter (Paladin) on May 31, 2007 at 15:43 UTC

    Scenario: You want to make your own nodelet which behaves exactly like a real nodelet, to contain certain custom content. (We'll call this content B, for Body.)

    Solution: Edit your Free Nodelet and duplicate the same form of "separator" html which occurs between actual nodelets.

    Implementation: View the html source and see what stuff goes between each nodelet. (We'll call this stuff H, for Header.) Put B at the bottom of your Free Nodelet, and put H just above it. Be sure to customize the content of H for titles, IDs, etc.

    For example, if you wanted to make a "real" nodelet out of your Mini Super Search form, you could put the following H above the form code:

    </td> </tr> </tbody> <!-- Nodelet Break --> <tbody class="nodelet" id="Mini_Super_Search"> <tr class="nodelet_head_row" id="nodelet_head_row_Mini_Super_Sea +rch"> <th class="nodehead"> Mini Super Search </th> </tr> <tr class="nodelet_body_row" id="nodelet_body_row_Mini_Super_Sea +rch"> <td class="nodebody">

    PS — If you set "display nodelets as div" in your Display Settings, you will have to adjust the above to reflect the use of div rather than table/tr/td.

    A word spoken in Mind will reach its own level, in the objective world, by its own weight
Re: Free Nodelet Hack: Mini Super Search
by naikonta (Curate) on May 22, 2007 at 19:16 UTC
    Creating personal SS does make sense of course. I think I can expand this. Thanks jdporter, for providing some kind of a work base.

    Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://616580]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-03-29 09:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found