我要在我的wagtail网站上为“页面”部分添加搜索面板。 但是,即使wagtail支持管理部分(https://docs.wagtail.io/en/v2.0/advanced_topics/customisation/admin_templates.html)的自定义模板,我也无法在此页面中添加搜索输入,例如“图片”,“文档”等。
我试图添加模板dashboard.templates.wagtailadmin,如下所示:
{% extends "wagtailadmin/pages.html" %}
{% block branding_welcome %}
<div class="left">
<div class="col header-title">
<h1 class="icon icon-doc-full-inverse">
Pages</h1>
</div>
<form
class="col search-form"
action="/admin/choose-page/search/?page_type=wagtailcore.page"
method="get"
novalidate=""
role="search">
<ul class="fields">
<li class="required">
<div class="field char_field text_input field-small iconfield">
<label for="id_q">Cerca termine:</label>
<div class="field-content">
<div class="input icon-search ">
<input type="text" name="q" placeholder="search" required="" id="id_q">
<span></span>
</div>
</div>
</div>
</li>
<li class="submit visuallyhidden"><input type="submit" value="Search" class="button"></li>
</ul>
</form>
</div>
{% endblock %}