diff --git a/blocks/partner-showcase/partner-showcase.js b/blocks/partner-showcase/partner-showcase.js index da402a7e..c3c391f1 100644 --- a/blocks/partner-showcase/partner-showcase.js +++ b/blocks/partner-showcase/partner-showcase.js @@ -332,16 +332,26 @@ export default async function decorate(block) { const renderPartnerCategory = (partner) => { if (partner.category !== '') { const categoriesArray = partner.category.split(','); - const firstCategory = categoriesArray.find((category) => category.includes('partner-type')); let markup = ''; - const removePrefixCategory = firstCategory.split('/')[2]; - const replaceHyphenCategory = removePrefixCategory.replaceAll('-', ' '); - const replaceAmpCategory = replaceHyphenCategory.includes('&') - ? replaceHyphenCategory.replace('&', '&') - : replaceHyphenCategory; - markup = `

${replaceAmpCategory}

`; + + // Iterate through all categories and process those that contain 'partner-type' + categoriesArray.forEach((category) => { + if (category.includes('partner-type')) { + const removePrefixCategory = category.split('/')[2]; + const replaceHyphenCategory = removePrefixCategory.replaceAll('-', ' '); + const replaceAmpCategory = replaceHyphenCategory.includes('&') + ? replaceHyphenCategory.replace('&', '&') + : replaceHyphenCategory; + + // Append the processed category to the markup + markup += `

${replaceAmpCategory}

`; + } + }); + + // Return all categories as markup if any were found return markup; } + return ''; };