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

Commit

Permalink
Merge pull request #697 from B77Mills/VideoIconSectionNodes
Browse files Browse the repository at this point in the history
Add section-feeed-node ${contentType}-content-type modifier
  • Loading branch information
brandonbk authored Apr 28, 2023
2 parents 2e9b3b0 + 57ccffa commit 5f2feaf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { getAsObject, get } from "@parameter1/base-cms-object-path";
import { getAsObject, getAsArray, get } from "@parameter1/base-cms-object-path";
import { buildImgixUrl } from "@parameter1/base-cms-image";
import defaultValue from "@parameter1/base-cms-marko-core/utils/default-value";

$ const { site, i18n } = out.global;

$ const content = getAsObject(input, "node");
$ const { company } = content;
$ const contentType = defaultValue(content.type, 'article');
$ const modifiers = [...getAsArray(input, "modifiers"), `${contentType}-content-type`]
$ const withCompany = (company) ? defaultValue(input.withCompany, true) : false;
$ const primaryImage = getAsObject(content, "primaryImage");
$ const primarySection = getAsObject(content, "primarySection");
Expand All @@ -29,7 +31,7 @@ $ const lazyload = defaultValue(input.lazyload, true);
Keys are content types (all lowercase), values are the field to use when available on that type.
**/
$ const linkOffsite = getAsObject(site, "config.linkOffsite");
$ const linkField = get(linkOffsite, get(content, "type"));
$ const linkField = get(linkOffsite, contentType);
$ const linkTarget = linkField && get(content, linkField) ? defaultValue(get(linkOffsite, "target"), "") : "";

$ const imageOptions = {
Expand All @@ -48,7 +50,7 @@ $ const mobileImageOptions = {

$ const blockName = "section-feed-content-node";

<marko-web-block name=blockName modifiers=input.modifiers attrs=containerAttrs>
<marko-web-block name=blockName modifiers=modifiers attrs=containerAttrs>
<marko-web-element block-name=blockName name="contents">
<marko-web-element block-name=blockName name="body">
<if(input.sponsoredBy)>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,26 @@
}
}
}
&--video-content-type {
#{ $self } {
&__image-wrapper {
position: relative;
&::after {
position: absolute;
top: 50%;
left: 50%;
width: 50px;
height: 50px;
content: "";
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAZ8SURBVHhe7Z1Z6O1TFMf/hswhY+Yx3UiR8UF4IUIoD3QfyAPu7UYpDzLHgweRB8mUPJgyS3mQTGVKxohkypTpIkNmvp/cX3Fb53/273f2Xnvv39nf+jzc4ezfsM7Za+291157oampqampacTaXhwpVojrxGPiDfG+WCl+E3+LP1f9+SPxlnha3CTOE8eJPcQaoqmnthFLxS2Cl87LjsUX4m5xpsBATRO0meAX8KywXmQq3hYXiR1Fk0RXdL/4RVgvzIu/xFOCX+baYq5EP368eEFYLyc3dJNniHXF6IVzfV1YL6I0PhHLxZpidNpJPCSsBy+dl8QBYhSiPz5f/CSsh60FQurrxaaiWhG5MBawHrBW8C/7i+p0jPhaWA9VO0SE54gqBpnc5OWCMNJ6mDFxr1hfFKu1xM3Cuvmx8owo0q/wTak1ipqV1wTTPcVoA/G4sG52XvhAMAmaXXRT8/rLWB0GvJuLbMKBz5vPmMbzgh4ji64Q1k3NO/QY9ByuYpwxD6HtUC4UbtpBjHXQF4s/xGEiuZibIva2bqLxfz4VW4mkYqLQunjD5h6RTEyh1z5rm4OjRRK18cYw3hXriag6VlgXi83vxt+NgUtFNDEA9Fp2vUOcIsitsv69Vn4Q0UbxJCRYF0nB7QIxWXmx+FlY/69GLhNR9KKwLpCCziCdWHXkVzOGQei3YhMxk44QVuOpWN0gnQ4WzwnrMzXBsGEm3SeshlMxySAIX3aq+ExYn62BD8XgpV/SO38VVsOpWMwgnTYSTGzW6l8GT6mQJGY1mJIQg3Tq/IvVTsmQRD5IOfrsPgbpdLh4WVjtlcj3oveaybbCaiw1QwyCSPc8XdTiX0ip7SWywK2GUjPUIJ3wL1cKb9/Xl6tFL+VammVrQgztLmjLukYJvCp6iSwKq6HUPCJ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ZApwhR60lnbHGJpllMCKExvPXhpsOxKqcPgym+1ijRKdjCtFNaLyA0z2TeIqGvgNWhjQVW1UtbQ6ZrImyrixM6com8+VBBKehct4NdAdTnqHwaVSpo34WfY48g3lVKqKXKLSfwjR4qyGcwuNPUQDpXkZLo2fkGEnqG+hzEDGY93CTZYYgASyJsSiO6F4GBXsY84UOy36s+cHZjtPNqmpqampqY8Wlj4B3teNzXdJUMzAAAAAElFTkSuQmCC");
filter: brightness(0) invert(1) drop-shadow(2px 2px 2px rgba(0, 0, 0, .5));
background-size: contain;
opacity: .6;
transform: translate(-50%, -50%);
}
}
}
}
}

.node-list {
Expand Down

0 comments on commit 5f2feaf

Please sign in to comment.