Skip to content

Commit

Permalink
Merge pull request #80 from jwade1327/weekly-am
Browse files Browse the repository at this point in the history
Create AM Weekly
  • Loading branch information
Shinsina authored Jun 20, 2024
2 parents b42b5aa + e7b0287 commit bc917d3
Show file tree
Hide file tree
Showing 4 changed files with 216 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tenants/all/config/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,15 @@ const config = {
},
preferenceCenter: 'https://www.auntminnieeurope.com/user/subscribe',
},
'am-weekly': {
...brands.am,
name: 'AuntMinnie-Weekly',
logo: {
src: '/files/base/smg/all/image/static/am/AM_Weekly.png',
footerWidth: 200,
},
preferenceCenter: 'https://www.auntminnie.com/user/subscribe',
},
};

module.exports = config;
20 changes: 20 additions & 0 deletions tenants/all/config/email-x.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,26 @@ config
width: 300,
height: 250,
},
])
.setAdUnits('am-weekly', [
{
name: 'ad-slot-1',
id: '6674422515168281400d5833',
width: 300,
height: 250,
},
{
name: 'ad-slot-2',
id: '6674423d311907bdd103a543',
width: 300,
height: 250,
},
{
name: 'case-sponsor',
id: '66744255311907260003a556',
width: 300,
height: 250,
},
]);

module.exports = config;
4 changes: 4 additions & 0 deletions tenants/all/config/native-x.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,9 @@ module.exports = {
'ame-radcast': {
'slot-1': '6549475a91f3fc0001ea907c',
},
'am-weekly': {
'case-sponsor': '6674430f49e2ea000100c0f2',
sponsored: '66744322f0716b0001d593cf',
},
},
};
183 changes: 183 additions & 0 deletions tenants/all/templates/am-weekly.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
import { get } from "@parameter1/base-cms-object-path";
import { parseBooleanHeader } from "@parameter1/base-cms-utils";
import queryFragment from "@science-medicine-group/package-common/graphql/fragments/content-list";
import defaultValue from "@parameter1/base-cms-marko-core/utils/default-value";

$ const { website, config, req } = out.global;
$ const { newsletter, date } = data;

$ const emailX = config.get("emailX");
$ const nativeX = config.getAsObject("nativeX");
$ const { id, alias, name, pageNode } = input;

$ const newsletterConfig = config.get(newsletter.alias);
$ const caseBlock = get(newsletterConfig, "caseBlock");
$ const ctaLinkStyle = defaultValue(newsletterConfig.ctaLinkStyle, undefined);

$ const resolvedToNodesConverter = ({ resolved }) => (resolved.map((node) => ({
id: node.ID,
type: 'Case',
shortName: node.name,
teaser: node.description,
siteContext: { url: `https://my.auntminnie.com/cases/${node.url}` },
primaryImage: { src: node.imagepath }
})));

<marko-newsletter-root
title=newsletter.name
description=newsletter.description
date=date
>
<@head>
<common-head-block />
</@head>
<@body style="padding:0; margin:0;font-family: 'Roboto', Arial, sans-serif; -webkit-text-size-adjust:100%;">
<common-body-wrapper-block newsletter=newsletter date=date footer=input.footer>
<@body>

<common-content-list-block
date=date
section-name="Letter from the Editor"
newsletter=newsletter
with-image=true
image-position="right"
with-header=true
continue-reading=true
limit=1
/>

<common-content-list-block
date=date
section-name="Radiology News"
newsletter=newsletter
with-image=true
image-position="right"
with-header=true
limit=1
skip=0
/>

<common-content-list-block
date=date
section-name="Radiology News"
newsletter=newsletter
with-image=false
with-section=true
limit=2
skip=1
/>

<!-- Ad Slot 1 -->
<common-ad-wrapper-block
newsletter=newsletter
ad-unit=emailX.getAdUnit({ name: 'ad-slot-1', alias: newsletter.alias })
date=date
/>

<common-content-list-block
date=date
section-name="Radiology News"
newsletter=newsletter
with-image=false
with-section=true
limit=11
skip=3
/>

<common-content-list-block
date=date
section-name="Insider"
newsletter=newsletter
with-image=true
image-position="right"
with-header=true
continue-reading=true
limit=1
/>

<common-content-list-block
date=date
section-name="Insider"
newsletter=newsletter
with-image=false
with-header=true
continue-reading=true
limit=1
skip=1
/>

<!-- Ad Slot 2 -->
<common-ad-wrapper-block
newsletter=newsletter
promotion-component="advertisement-block"
ad-unit=emailX.getAdUnit({ name: 'ad-slot-2', alias: newsletter.alias })
date=date
/>

<common-content-list-block
date=date
section-name="Insider"
newsletter=newsletter
with-image=false
with-section=true
limit=8
skip=2
/>

<if(caseBlock === true)>
<tr>
<td align="center" valign="top">
<table role="presentation" width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="background: #eff1f3;">
<tr>
<td align="center" valign="middle" height="38">
<p style="font-size:15px;color: #000000;text-decoration: none;display: block;font-weight:700;font-family:'Roboto', Arial, sans-serif;text-transform: uppercase;padding: 0 24px;">
Case of the Week
</p>
</td>
</tr>
</table>
</td>
</tr>
<common-table-spacer-element height="24" />

<common-ad-wrapper-block
newsletter=newsletter
promotion-component="advertisement-block"
ad-unit=emailX.getAdUnit({ name: 'case-sponsor', alias: newsletter.alias })
date=date
/>

<common-external-api-block
api-url="https://my.auntminnie.com/wp-json/mo/v1/getCase/1"
resolved-to-nodes-converter=resolvedToNodesConverter
name="Case of the Week"
description="Check out our Case of the Week!"
button={ link: "https://my.auntminnie.com/cases", text: "View All Cases" }
cta-link-style=ctaLinkStyle
/>
</if>

<common-content-list-block
date=date
section-name="RADCast"
newsletter=newsletter
with-image=false
with-header=true
with-section=true
limit=10
/>

<common-ad-wrapper-block
date=date
newsletter=newsletter
promotion-component="25-for-25-block"
placement-id=get(nativeX, `placements.${newsletter.alias}.sponsored`)
/>

</@body>
<@footer>
<common-new-footer-block newsletter=newsletter />
</@footer>
</common-body-wrapper-block>
</@body>
</marko-newsletter-root>

0 comments on commit bc917d3

Please sign in to comment.