Skip to content

Commit

Permalink
Merge pull request #520 from hlxsites/519-product-category-list-conve…
Browse files Browse the repository at this point in the history
…rter

519 Added placeholder for product category list
  • Loading branch information
rgravitvl authored Nov 30, 2023
2 parents 84d2fcf + 252fa9f commit eac5e4d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/actions/convert/test/fixtures/product1-converted.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
</div>
</div>
</div>
<div class="product-category-list">
<div>
<div></div>
</div>
</div>
<div class="mini-teasers">
<div>
<div>
Expand Down
9 changes: 9 additions & 0 deletions tools/actions/convert/test/fixtures/product1.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,15 @@

</template>
</grid></div>
<div class="text aem-GridColumn aem-GridColumn--default--12"><div data-cmp-data-layer="{&#34;product-category-list&#34;:{&#34;@type&#34;:&#34;danaher/components/content/marketing/text&#34;,&#34;repo:modifyDate&#34;:&#34;2023-11-30T06:47:48Z&#34;,&#34;xdm:text&#34;:&#34;&lt;p>Product Category List&lt;/p>\r\n&#34;}}" id="product-category-list" class="cmp-text href-text">

<p>Product Category List</p>

</div>



</div>
<div class="experiencefragment aem-GridColumn aem-GridColumn--default--12">


Expand Down
2 changes: 2 additions & 0 deletions tools/importer/transformers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import table from './table.js';
import libraryHub from './libraryHub.js';
import sideNav from './sideNav.js';
import miniTeaser from './miniTeaser.js';
import productCategoryList from './productCategoryList.js';

// eslint-disable-next-line import/prefer-default-export
export const transformers = [
Expand Down Expand Up @@ -67,6 +68,7 @@ export const transformers = [
libraryHub,
sideNav,
miniTeaser,
productCategoryList,
];

export const xfTransformers = [
Expand Down
11 changes: 11 additions & 0 deletions tools/importer/transformers/productCategoryList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* global WebImporter */
const createProductCategoryList = (main, document) => {
const placeholder = main.querySelector('div#product-category-list');
if (placeholder) {
const block = [['Product category list'], ['']];
const table = WebImporter.DOMUtils.createTable(block, document);
placeholder.innerHTML = '';
placeholder.append(table);
}
};
export default createProductCategoryList;

0 comments on commit eac5e4d

Please sign in to comment.