Closed ivanrvpereira closed 8 years ago
Hello @balsagoth,
I usually create a template tag that renders a template which contains the search form. This encapsulates any logic necessary for the search form to function in a template tag.
Then I use the tag on my base template.
Example:
@inclusion_tag('includes/global_search_form.html')
def render_search_form():
context = {
'form': SearchForm()
}
return context
The template can be something like:
<form action="{% url "search_form" %}" method="get">
<input id="field-search" name="q" placeholder="Search" >
</form>
Because the approach varies a lot from project to project, this is something that Aldryn Search can't provide out of the box.
Great @czpython! Thanks for your help.
Hello ! I have these error:
name 'SearchForm' is not defined
can you help me ?
Hi,
I want to make the search form available on my menu bar, but i cant see how i make this app globally available. Maybe this is a dumb question.