SAP Spartacus Page Layout - 頁面布局設計

      網友投稿 806 2025-04-04

      Page Structure - 頁面結構

      Pages in CMS are constructed with slots and components. A page contains slots, and slots contain components.

      CMS 頁面由 slots 和 components 組成。 頁面包含 slots,slots 包含 Components.

      SAP Spartacus Page Layout - 頁面布局設計

      To organize common slots and components, Spartacus supports page templates.

      為了支持通用 slots 和 Components,Spartacus 支持 page template.

      A page template contains layout and components that can be used globally, such as header and footer sections.

      下面這張圖展示了 id 為 homepage 的頁面,其頁面模板為 Landing Page 2 Template.

      home 頁面包含的 Content slots:

      把 SiteLogo 拿出來單獨看。

      在 SiteLogo 這個 Slot 里查看,他放置了哪些 Component:

      這里能查看到一個 slot 里到底分配了哪些 Components:

      The CMS provides the page structure, but it does not provide a clear layout definition.

      CMS 只定義了頁面結構,但不負責提供頁面布局定義。

      The page structure only provides an ordered list of components per slot, but the slots themselves do not have meta info on how they should be rendered in the layout.

      頁面結構只定義了一個 slots的有序列表,每個 slots 里又包含了一個 Components 的有序列表。Slots 本身并不包含布局信息。

      To provide layout information to the view logic, Spartacus uses a LayoutConfig configuration object to render the page slots in a given order. Additionally, you can use CSS rules to provide a specific layout.

      Spartacus 使用 LayoutConfig 配置對象,來按照順序渲染頁面 slots.

      Spartacus makes no distinction between page templates and page sections, and you can configure both with the LayoutConfig.

      Spartacus 不區分 Page template 和 page section.

      For each template or section, the slots can be configured in a specific order.

      對于每一個 page template,Spartacus 還提供了額外的配置自由度:可以再次調整 slots 的相對順序。

      const defaultLayoutConfig: LayoutConfig = { header: { slots: [ 'TopHeaderSlot', 'NavigationSlot' ] }, footer: { slots: ['FooterSlot'] }, LandingPageTemplate: { slots: [ 'Section1', 'Section2A', 'Section2B' ] } };

      Using Outlets to Override Page Templates

      When page templates, slots or components are rendered dynamically rendered in Spartacus, outlets get added for each slot.

      每個 outlet 都關聯了一個 outlet.

      Outlets can be use to replace part of a page template in Spartacus.

      outlet 可以被用來替換 Spartacus page template 的一部分。

      The outlets for the slots are easy to find as their label corresponds to name of the element being wrapped.

      下列是一個例子,如何用自定義 HTML 片段替換標準的 Component:

      Custom Title

      當然,用 Component 替換方式更簡單直接。

      Outlet 上下文

      前面說過,outlet reference 可以關聯一個 page template,一個 page slot / section 或者一個 template.

      根據關聯元素類型的不同,其上下文(outlet context) 也不相同。

      看個例子:

      "Section1" position

      {{ model.components$ | async | json }}

      毫無疑問,Section1 是一個 Slot:

      注意,Backoffice 里搜索屬性需要點擊 + icon,添加成功后,才能在搜索中生效。

      Section1 slot 里包含的是如下兩個 Splash Banner Components:類型都為SimpleResponsiveBannerComponent.

      第二個 Component:

      按照 SAP 幫助文檔的介紹,outlet context 包含的 components$ 包含的是 slot 里包含的 Component 列表。

      outlet 生效的頁面:

      原始界面:

      另一個例子:

      Campaign UI for Canon

      效果:

      ABAP ERP javaScript web前端

      版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。

      版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。

      上一篇:為什么升級 會員了,還是不能正常使用單元格(為什么升級完鴻蒙系統感覺卡了)
      下一篇:企業生產管理課件(生產管理教案)
      相關文章
      日韩va亚洲va欧洲va国产| 亚洲一区二区三区在线视频| 亚洲人成精品久久久久| 亚洲人成人网站在线观看| 亚洲福利精品电影在线观看| 亚洲AV香蕉一区区二区三区| 亚洲国产一区二区三区在线观看 | 亚洲午夜久久久久久尤物| 麻豆亚洲av熟女国产一区二| 亚洲人成影院在线| 亚洲精品美女在线观看播放| 亚洲精品福利网站| 亚洲国产成人无码av在线播放| 亚洲小说图片视频| 亚洲综合偷自成人网第页色| 亚洲高清一区二区三区| 亚洲精品无码久久久久牙蜜区| 亚洲色大成网站www永久网站 | 国产成人亚洲综合无码精品| 久久久久久亚洲精品中文字幕| 亚洲Av无码精品色午夜| 久久久久亚洲AV无码网站| 亚洲国产精品综合久久网各| 亚洲一区二区三区播放在线| 中文有码亚洲制服av片| 精品亚洲国产成人av| 亚洲国产一区视频| 国产精品亚洲一区二区三区在线 | 亚洲av中文无码乱人伦在线咪咕| 亚洲AV无码精品色午夜在线观看| 久久精品国产亚洲AV无码麻豆| 久久亚洲精品成人AV| 亚洲人成www在线播放| 亚洲日本成本人观看| 另类图片亚洲校园小说区| 最新亚洲成av人免费看| 亚洲日本精品一区二区| 亚洲免费视频播放| 日韩欧美亚洲国产精品字幕久久久| 亚洲精品视频免费观看| 国产亚洲精品国产|