Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Add ability to pass html strings into body injection
Browse files Browse the repository at this point in the history
  • Loading branch information
B77Mills committed Jul 21, 2023
1 parent a13e526 commit 64b5a8f
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import GAMDefineDisplayAd from "@parameter1/base-cms-marko-web-theme-monorail/co
$ const { global: $global } = out;
$ const { GAM } = $global;
$ const { content, modifiers } = input;
$ const htmlInjections = getAsArray(input, "htmlInjections");
$ const preventHTMLInjection = getAsArray(content, "labels").some( l => ["Sponsored", "Product Spotlight"].indexOf(l) >= 0) || input.preventHTMLInjection;
$ const blockName = defaultValue(input.blockName, 'page-contents');
$ const aliases = getAsArray(input, 'aliases');
Expand Down Expand Up @@ -76,6 +77,17 @@ $ const gamAdInjection = (GAM) ? [
lazyload-first-image=input.lazyloadFirstImage
/>
<if(!preventHTMLInjection)>
<if(htmlInjections.length)>
<for|htmlInjection| of=input.htmlInjections>
$ const { at, html } = htmlInjection;
<if (at && html)>
<@inject
at=at
html=html
/>
</if>
</for>
</if>
<for|adInjection| of=gamAdInjection>
$ const { counts, name, modifiers } = adInjection;
<if(adInjection.counts.length)>
Expand Down

0 comments on commit 64b5a8f

Please sign in to comment.