【发布时间】:2019-02-13 07:32:12
【问题描述】:
我正在尝试将撇号搜索模块合并到我的撇号 cms 项目中,但遇到了模板错误。
我一直按照apostrophe cms documentation 和npm apostrophe-search tutorial 中的步骤安装撇号搜索:
我已经使用 npm 在我的项目目录中安装了撇号搜索:
npm install apostrophe-search
我把这个模块和我的 app.js 文件放在模块部分。
将模块添加到 app.js 的默认搜索似乎工作正常(见下文)
但是当我尝试按照步骤自定义此搜索时,我遇到了问题。
我已尝试将以下代码块放在我的 index.html 中的一个撇号页面中,以尝试使用迷你搜索工具的默认功能:
{% include "search:miniForm.html" %}
但遇到以下错误:
e.stack: Template render error: (vendor-pages:index.html)
Error: Module doesn't exist: search
我还尝试在我的项目中创建一个 apostrophe-search 模块文件夹,使其看起来像 project/lib/modules/apostrophe-search/views/ 并复制在 node_modules 中找到的 apostrophe-search 模块的 index.html库,但是当我加载 localhost:3000/search 页面时,我遇到了另一个错误:
e.stack: Template render error: (apostrophe-search:index.html)
Template render error: (apostrophe-search:index.html)
Error: template not found: apostrophe-search:pagerMacros.html
这似乎是我的目录结构方式的问题,但我不确定,因为我相信我已正确遵循文档中的步骤。任何帮助将不胜感激。
【问题讨论】:
标签: apostrophe-cms