为什么AEM中的标头和页脚应定义为经验片段,而不是使它们成为标头或页脚组件?

发布于 2025-02-07 21:43:56 字数 51 浏览 3 评论 0原文

在AEM中,我看到将标题作为将其作为组成部分的体验片段作为体验片段的好处。有什么理由吗?

In AEM, I see that its good to make the header as an experience fragment that making it as a component. Any reasoning for that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

三生一梦 2025-02-14 21:43:56

两者都是有效的。但是,体验片段方法更好地归结为几件事的原因:

  1. 较少的组件,重用现有组件。
  2. 可以在不需要开发的情况下完成对标头和页脚的更改。
  3. 标题和页脚是自包装的,并且可以在必要时查询AEM以外的地方使用。
  4. 体验片段变化使您可以为各种情况创建不同的标头/页脚选项,但将它们放在一个易于理解的地方。

Both are valid. But the reason the Experience Fragment method is better comes down to a few things:

  1. Fewer components, reuse of existing components.
  2. Changes to the header and footer may be accomplished without the need for development
  3. The header and footer are self contained and could be queried for use outside of AEM if necessary.
  4. Experience Fragment variations allow you to create different header/footer options for various scenarios, but keep them in one place that is easy for authors to understand.
尹雨沫 2025-02-14 21:43:56

根据AEM文档,页面模板可以包含类似的基本组件,以弥补带标头,车身和页脚

  • 导航组件

    的完整页面

  • 容器组件

  • 体验片段

参考文献文档: https://experienceleague.adobe.com/docs/experience-manager-core-components/using/get-started/localization.html?lang=en

According to AEM documentation, a page template can contain essential components like below to make up a complete page with header, body and footer

  • Navigation Component

  • Container Component

  • Experience Fragment

Reference documentation : https://experienceleague.adobe.com/docs/experience-manager-core-components/using/get-started/localization.html?lang=en

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文