Home Learn More Purchase Knowledge Base Support Contact

Community Forums

KBPublisher Forums » KBPublisher Code Hacks and Customization Discussion

Include search from separate page

(9 posts)

No tags yet.


  1. chrisbjax
    Member

    Hi all,
    I was curious if its possible to include the search feature from a page outside of the knowledgebase?

    To further explain:
    kb is located at http://url/kb/index.php

    I have a page : http://url/page.php
    I would like to add a search box here, and have it direct the output into the kb.
    How would this be accomplished?
    Thank you

    Posted 3 years ago #
  2. onesign
    Key Master

    Hi,

    Just place this code to any page you need

    ----
    <form action="http://www.domain.com/kb_directory/index.php?View=search">
    o<input type="hidden" name="s" id="s" value="1" />
    o<input type="text" name="q" id="searchq" value="" />
    o<input type="submit" name="sb" id="sb" value="Search KB" />
    </form>
    ----

    Regards,
    Evgeny

    Posted 3 years ago #
  3. chrisbjax
    Member

    This populates the general search field and brings me to the knowledgebase, I then have to press the search button a second time. Is there any way to have it perform the query so we don't have to run it twice?

    Posted 3 years ago #
  4. onesign
    Key Master

    This one
    ---
    <form action="http://www.domain.com/kb/index.php">
    <input type="hidden" name="View" value="search" />
    <input type="hidden" name="s" id="s" value="1" />
    <input type="text" name="q" id="searchq" value="" />
    <input type="submit" name="sb" id="sb" value="Search KB" />
    </form>

    Posted 3 years ago #
  5. chrisbjax
    Member

    That's it!

    Thank you very much onesign!

    Posted 3 years ago #
  6. nidave
    Member

    is there a way to add this search plus a drop down searching a specific category?

    Posted 3 years ago #
  7. onesign
    Key Master

    From separate page?
    Add to the form
    <select name="c[]">
    <option value="38">Categories</option>
    <option value="24">-- Articles</option>
    ...
    </select>

    Posted 3 years ago #
  8. nidave
    Member

    Fantastic - thanks - one more question - if I just add the main categories - not the sub categories to the list will the sub categories be included in the search?

    Posted 3 years ago #
  9. nidave
    Member

    Sorted it - added <input type="hidden" name="s" id="s" value="1" /> to the form.
    Thanks very much for your help.

    Posted 3 years ago #

RSS feed for this topic

Reply

You must log in to post.

© 2008 Double Jade LLC | customer.service@kbpublisher.com