Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok, first up, <em>I second googletorps suggestion to look at a <a href="http://drupal.org/project/views" rel="nofollow noreferrer">views</a> based solution first</em>, as it can save you quite some custom coding. However, I often find myself in a position where a views based solution turns out to offer only 80% of what I need and adding the missing 20% with views can be more work than a custom solution right from the start - check out views with exposed filters and see if it fits.</p> <p>If it doesn't, here are some hints that should get you started for a custom solution:</p> <ul> <li>As for the search form, a block is the right way to go. Take a look into <a href="http://api.drupal.org/api/function/hook_block/6" rel="nofollow noreferrer"><code>hook_block()</code></a> for how to create one (you'll need to implement at least operations 'list' and 'view' for this)</li> <li>Placement would happen via build/block as you said</li> <li>On operation 'view', you would build your form. Take a look into the <a href="http://api.drupal.org/api/drupal/developer--topics--forms_api.html/6" rel="nofollow noreferrer">forms API Quickstart</a> and <a href="http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/6" rel="nofollow noreferrer">reference</a> for form handling in Drupal (do not build your own forms manually - the Drupal forms API needs only a bit of getting used to and will save you tons of time in the future)</li> <li>For the result pages, you'd register your own page callback function for the paths you want, see <a href="http://api.drupal.org/api/function/hook_menu/6" rel="nofollow noreferrer"><code>hook_menu()</code></a> for this. <ul> <li><strong>Warning:</strong> Your proposed path 'search/...' would conflict with Drupals build in search path, so you might consider choosing a slight variation (e.g. 'search/people/...' or 'peoplesearch/' or the like)</li> </ul></li> <li>For link creation in Drupal, use the <a href="http://api.drupal.org/api/function/l/6" rel="nofollow noreferrer">l()</a> function</li> <li>For pagination you <em>might</em> be able to use <a href="http://api.drupal.org/api/function/theme_pager/6" rel="nofollow noreferrer"><code>theme_pager</code></a>, but this depends on how straight your actual search query turns out, as it expects an array of query string parameters to build the query</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload