Answer the question
In order to leave comments, you need to log in
How to integrate search into a template?
Hello, please tell me how to integrate the search into the template? I am using cms django. I tried to create a new page and assign the application "Aldryn search" to it, the search appears there, but when using it, everything flies with an error: dpaste.com/1K3EJ91 . Tell me where did I turn wrong?
The search plugin itself https://github.com/divio/aldryn-search
settings.py
INSTALLED_APPS = [
'aldryn_search',
]
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
},
}
HAYSTACK_ROUTERS = ['aldryn_search.router.LanguageRouter',]
ALDRYN_SEARCH_REGISTER_APPHOOK = True
{% cms_toolbar %}
{% block header %}
<header role="header">
<div class="container">
<!-- logo -->
<h1>
<a href="/" title="avana LLC"><img src="{{ STATIC_URL }}img/logo.png" title="avana LLC" alt="avana LLC"/></a>
</h1>
<!-- nav -->
<nav role="header-nav" class="navy">
<ul>
{% show_menu 0 100 100 100 %}
</ul>
</nav>
</div>
</header>
{% endblock header %}
Answer the question
In order to leave comments, you need to log in
I fixed the error by adding the plugin to the aldryn search sidebar, but then I got an error with 'CMSToolbar' object has no attribute 'edit_mode'. I fixed it by finding the views.py file, on line 265 I fixed it to:
This is for those who had similar dances with a tambourine :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question