Jump to main content Jump to doc navigation

AdvSearchForm's tpl Chunk

A Chunk named "AdvSearchForm" is provided with AdvSearch. This Chunk name is set as &tpl property on the AdvSearchForm snippet.

Default Value

<form class="advsea-search-form" action="[[~[[+landing]]]]" method="[[+method]]">
  <fieldset>
    <input type="hidden" name="id" value="[[+landing]]" />
    <input type="hidden" name="asId" value="[[+asId]]" />
    [[+helpLink]]<input type="text" id="[[+asId]]_search" name="[[+searchIndex]]" value="[[+searchValue]]" />
    <input type="submit" name="sub" value="[[%advsearch.search? &namespace=`advsearch` &topic=`default`]]" />
  </fieldset>
</form>
[[+resultsWindow]]

Available Placeholders

Name Description
asId AdvSearch identifier. This placeholder is required in the search form template to distinguish advSearch instances.
helpLink Where is displayed the link for opening the advanced search help
landing The id of the resource to show search results on. Defaults to the current Resource.
method Whether to submit over GET or POST. Defaults to GET.
searchValue The default or current search value.
searchIndex The REQUEST var used for the search parameter.
resultsWindow div section where will be attached the search results window. (ajax mode)

Search form customization

The searchForm chunk should contain:

  • an action: action="[[~[[+landing]]]]"
  • a method: method="[[+method]]"
  • a hidden input field named asId: <input type="hidden" name="asId" value="[[+asId]]"> for the form instance
  • a hidden input field named id: <input type="hidden" name="id" value="[[+landing]]"> with the landing page id
  • a submit input field named "sub".

and possibly:

  • an input text field: <input type="text" id="[[+asId]]_search" name="[[+searchIndex]]" value="[[+searchValue]]" /> For a form without a search input field, simply remove this line from the form.
  • the help link: [[+helpLink]] To hide the help link use the &help parameter to remove the placeholder altogether.

Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.

Backers

  • modmore
  • STERC
  • Digital Penguin
  • Jens Wittmann – Gestaltung & Entwicklung
  • Fabian Christen
  • Dannevang Digital
  • Sepia River Studios
  • CrewMark
  • Chris Fickling
  • deJaya
  • eydolan
  • Lefthandmedia
  • Murray Wood
  • Following Sea
  • Anton Tarasov
  • Stéphane Jäggi
  • Raffy
  • Snow Creative
  • A. Moreno
  • Nick Clark
  • JT Skaggs
  • Helen
  • YJ
  • krisznet
  • Richard
  • Yanni

Budget

$306 per month—let's make that $500!

Learn more