是否需要其他配置才能使面包屑在Spartacus站点中可见? [英] Is there additional configuration needed to make the breadcrumbs visible in a Spartacus site?
问题描述
是否需要其他配置才能使面包屑在基于Spartacus的网站中可见? BottomHeaderSlot内部有一个BreadcrumComponent实例.如果我在基于JSP的站点中加载页面,则会为/warranty页面显示类似"HOME/Warranty"的面包屑.但是,当我加载基于Spartacus的网站时,它仅显示"HOME".我想念什么?我是否需要编辑CMS控制器或将BreadcrumbBuilder映射到它?
Is there additional configuration needed to make the breadcrumbs visible in a Spartacus-based site? There is a BreadcrumComponent instance inside the BottomHeaderSlot. If I load the page in the JSP-based site, a breadcrumb like "HOME / Warranty" is displayed for a /warranty page. But when I load the Spartacus-based site, it only shows "HOME". What am I missing? Do I need to edit the CMS controllers or map a breadcrumbBuilder to it?
推荐答案
由于我之前的误解,我正在更新自己的答案,对此感到抱歉.
I'm updating my answer as I misunderstood earlier, sorry for that.
面包屑在斯巴达克斯中由特定的 PageMetaResolver
解析.默认情况下,内容页面由 ContentPageMetaResolver
解析,您可以对其进行扩展.
Breadcrumbs are resolved in Spartacus by a specific PageMetaResolver
. The content pages are by default resolved by the ContentPageMetaResolver
, which you could extend.
为Content页面(如示例数据中的常见问题页面)解析的断点仅包含指向主页的链接.您可以通过提供 ContentPageMetaResolver
的自定义实现来对此进行自定义.
The breakpoints resolved for Content pages (like the faq page in the sample data) are only contain a link to the home page. You could customise this by providing a custom implementation for the ContentPageMetaResolver
.
-以前的答案,不再相关---
--- former answer, no longer relevant ---
可见性取决于CMS结构中 BreadcrumbComponent
的可用性.您可以在页面模板或特定页面中添加此组件.
The visibility depends on the availability of the BreadcrumbComponent
in the CMS structure. You can add this component in a page template or in a specific page.
You'll see this on the demo site, see https://spartacus.c39j2-walkersde1-d4-public.model-t.cc.commerce.ondemand.com/. On the home page there's no notion of the breadcrumb, while on other pages there is. In the sampledata, the BreadcrumbComponent is part of the components of the BottomHeaderSlot.
这篇关于是否需要其他配置才能使面包屑在Spartacus站点中可见?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!