https://github.com/magesuite/cms-product-backlink
The CMS Product Backlink feature allows referencing CMS Pages on the Product Detail page in case the product has been linked on the corresponding CMS Page. This is especially useful when having e.g. “how-to” CMS pages which contain Products (CC Product Carousel or CC Product Grid components). When accessing the product detail pages the user will have a backlink to the actual “how-to” CMS page.
Installation
This module is part of MageSuite metapackage
Installation if metapackage is not used:
composer require "creativestyle/magesuite-cms-product-backlink" ^1.0.0
User guide
Admin settings
The module can be configured in the admin panel. The functionality is disabled by default.
Stores -> Configuration -> MageSuite -> CMS Product Backlink
General settings
Name | Values | Note |
---|---|---|
Is Enabled | Yes/No | Disabled by default |
Update Backlink On Save | Yes/No | Select "Yes", if the "Cms Page Backlink" section on PDP should be refreshed after saving the cms page |
Excluded Pages | Choose excluded pages |
Backend
Backend documentation need to be added
Frontend
In catalog_product_view.xml
the following block is added
<referenceBlock name="product.info.details"> <block class="MageSuite\CmsProductBacklink\Block\Backlink" name="cms_product_backlink_block" template="MageSuite_CmsProductBacklink::/backlink.phtml" group="detailed_info" after="-"> </block> </referenceBlock>
It adds a new cms page backlink
section. An admin editor can configure sort order, title, and other standard magesuite options that are applied to the PDP content sections.
<arguments> <argument name="sort_order" xsi:type="string">120</argument> <argument name="title" xsi:type="string" translate="true">CMS Pages</argument> <argument name="contain_content" xsi:type="boolean">false</argument> <argument name="include_headline" xsi:type="boolean">false</argument> <argument name="is_collapsible" xsi:type="boolean">false</argument> </arguments>
There is also a possibility to configure the image teaser with cms page backlinks.
<argument xsi:type="array" name="data"> <item name="currentScenario" xsi:type="array"> <item name="desktopLayout" xsi:type="array"> <item name="id" xsi:type="string">2</item> </item> <item name="mobileLayout" xsi:type="array"> <item name="id" xsi:type="string">mobile-slider</item> </item> </item> <item name="content_align" xsi:type="array"> <item name="x" xsi:type="number">2</item> <item name="y" xsi:type="number">2</item> </item> <item name="scenario" xsi:type="array"> <item name="teaserWidth" xsi:type="array"> <item name="id" xsi:type="string">container</item> </item> <item name="contentPlacement" xsi:type="array"> <item name="id" xsi:type="string">over</item> </item> </item> <item name="componentVisibility" xsi:type="array"> <item name="mobile" xsi:type="string">1</item> <item name="desktop" xsi:type="string">1</item> </item> </argument>
Storefront screens
Styling
Backlink image teaser inherits standard image-teaser styles. It has an additional class cs-image-teaser--backlink
, however in theme-creativeshop no special styling is added.