Skip to content

Commit

Permalink
Merge pull request #7 from jwade1327/sab-drb
Browse files Browse the repository at this point in the history
Create new SAB, Dr B & LabPulse templates & ad slots
  • Loading branch information
Shinsina authored Mar 10, 2023
2 parents ce0f1b5 + d382ead commit e25ccbb
Show file tree
Hide file tree
Showing 15 changed files with 248 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/common/components/blocks/ad/wrapper.marko
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ const promotionComponents = {
};
$ const PromotionComponent = promotionComponents[defaultValue(input.promotionComponent, "advertisement-block")];

<if(nativeX.uri)>
<if(nativeX.uri && placementId)>
<native-x-fetch|{ data }| uri=nativeX.uri date=date placement-id=placementId>
<if(data)>
<${PromotionComponent}
Expand Down
47 changes: 47 additions & 0 deletions packages/common/components/layouts/breaking-news.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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";

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

$ const emailX = config.get("emailX");
$ const nativeX = config.getAsObject("nativeX");

<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>
<@body>

<!-- Content list block -->
<common-content-list-block
date=date
section-name="Main"
newsletter=newsletter
with-image=true
image-position="right"
with-section=true
limit=1
skip=0
/>

<!-- Ad Slot 1 -->
<common-ad-wrapper-block
newsletter=newsletter
promotion-component="advertisement-block"
ad-unit=emailX.getAdUnit({ name: 'ad-slot-1', alias: newsletter.alias })
placement-id=get(nativeX, `placements.${newsletter.alias}.slot-1`)
date=date
/>

</@body>
</common-body-wrapper-block>
</@body>
</marko-newsletter-root>
67 changes: 67 additions & 0 deletions packages/common/components/layouts/insider.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
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";

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

$ const emailX = config.get("emailX");
$ const nativeX = config.getAsObject("nativeX");

<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>
<@body>

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

<!-- Content list block -->
<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
/>

<!-- Ad Slot 1 -->
<common-ad-wrapper-block
newsletter=newsletter
promotion-component="advertisement-block"
ad-unit=emailX.getAdUnit({ name: 'ad-slot-1', alias: newsletter.alias })
placement-id=get(nativeX, `placements.${newsletter.alias}.slot-1`)
date=date
/>

<!-- Content list block -->
<common-content-list-block
date=date
section-name="Main"
newsletter=newsletter
with-image=true
image-position="right"
with-section=true
limit=10
skip=0
/>

</@body>
</common-body-wrapper-block>
</@body>
</marko-newsletter-root>
6 changes: 6 additions & 0 deletions packages/common/components/layouts/marko.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"<common-standard-layout>": {
"template": "./standard.marko"
},
"<common-breaking-news-layout>": {
"template": "./breaking-news.marko"
},
"<common-insider-layout>": {
"template": "./insider.marko"
}
}
4 changes: 2 additions & 2 deletions packages/common/components/layouts/standard.marko
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ $ const nativeX = config.getAsObject("nativeX");
/>

<!-- Content list block -->
<common-content-list-block
<!-- <common-content-list-block
date=date
section-name="Editor's Note"
newsletter=newsletter
Expand All @@ -72,7 +72,7 @@ $ const nativeX = config.getAsObject("nativeX");
with-header=true
continue-reading=true
limit=1
/>
/> -->

</@body>
</common-body-wrapper-block>
Expand Down
27 changes: 27 additions & 0 deletions tenants/all/config/brands.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,31 @@ module.exports = {
],
},
},
drb: {
logo: {
src: '/files/base/smg/all/image/static/drb/drb-logo.svg',
footerWidth: 200,
},
socialMedia: {
imagePath: '/files/base/smg/all/image/static/newsletter',
links: [
{ provider: 'facebook', href: 'https://www.facebook.com/DrBicuspid', target: '_blank' },
{ provider: 'twitter', href: 'https://twitter.com/drbicuspid', target: '_blank' },
],
},
},
sab: {
logo: {
src: '/files/base/smg/all/image/static/sab/sab-logo.svg',
footerWidth: 200,
},
socialMedia: {
imagePath: '/files/base/smg/all/image/static/newsletter',
links: [
{ provider: 'facebook', href: 'https://www.facebook.com/ScienceAdvisoryBoard', target: '_blank' },
{ provider: 'twitter', href: 'https://twitter.com/scienceboard', target: '_blank' },
{ provider: 'linkedin', href: 'https://www.linkedin.com/company/the-science-advisory-board/', target: '_blank' },
],
},
},
};
27 changes: 26 additions & 1 deletion tenants/all/config/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,34 @@ const config = {
},
'labpulse-lfte': {
...brands.labPulse,
name: 'Letter From The Editor',
name: 'LabPulse-Letter From The Editor',
preferenceCenter: 'https://www.labpulse.com/user/subscribe',
},
'labpulse-breaking-news': {
...brands.labPulse,
name: 'LabPulse-Breaking News',
preferenceCenter: 'https://www.labpulse.com/user/subscribe',
},
'labpulse-community-insider': {
...brands.labPulse,
name: 'LabPulse-Community Insider',
preferenceCenter: 'https://www.labpulse.com/user/subscribe',
},
'drb-lfte': {
...brands.drb,
name: 'Dr. Bicuspid-Letter From The Editor',
preferenceCenter: 'https://www.drbicuspid.com/user/subscribe',
},
'drb-breaking-news': {
...brands.drb,
name: 'Dr. Bicuspid-Breaking News',
preferenceCenter: 'https://www.drbicuspid.com/user/subscribe',
},
'drb-community-insider': {
...brands.drb,
name: 'Dr. Bicuspid-Community Insider',
preferenceCenter: 'https://www.drbicuspid.com/user/subscribe',
},
};

module.exports = config;
48 changes: 48 additions & 0 deletions tenants/all/config/email-x.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,54 @@ config
width: 300,
height: 250,
},
])
.setAdUnits('labpulse-community-insider', [
{
name: 'ad-slot-1',
id: '6406ae3af620c908f1892b97',
width: 300,
height: 250,
},
])
.setAdUnits('labpulse-breaking-news', [
{
name: 'ad-slot-1',
id: '6406ae62f620c93890892bbc',
width: 300,
height: 250,
},
])
.setAdUnits('drb-lfte', [
{
name: 'ad-slot-1',
id: '638616ca58002acd72708c99',
width: 300,
height: 250,
},
])
.setAdUnits('drb-community-insider', [
{
name: 'ad-slot-1',
id: '6406adc8f620c95b20892b32',
width: 300,
height: 250,
},
])
.setAdUnits('drb-breaking-news', [
{
name: 'ad-slot-1',
id: '6406adf2f89e5844504c5583',
width: 300,
height: 250,
},
])
.setAdUnits('sab', [
{
name: 'ad-slot-1',
id: '638616fd58002a6962708cd2',
width: 300,
height: 250,
},
]);

module.exports = config;
18 changes: 18 additions & 0 deletions tenants/all/config/native-x.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,23 @@ module.exports = {
'labpulse-lfte': {
'slot-1': '632b0922e063f70001d48fc8',
},
'labpulse-community-insider': {
community: '6406ac7a93fb8e0001c3abf3',
},
'labpulse-breaking-news': {
'slot-1': '6406aca393fb8e0001c3ac2a',
},
'drb-lfte': {
'slot-1': '638619dad6ced5000110a551',
},
'drb-community-insider': {
community: '6406acf593fb8e0001c3ac7c',
},
'drb-breaking-news': {
'slot-1': '6406ad19e78b060001976ca1',
},
sab: {
'slot-1': '63861a1cadecb1000112fe8b',
},
},
};
1 change: 1 addition & 0 deletions tenants/all/templates/drb-breaking-news.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<common-breaking-news-layout data=data />
1 change: 1 addition & 0 deletions tenants/all/templates/drb-community-insider.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<common-insider-layout data=data />
1 change: 1 addition & 0 deletions tenants/all/templates/drb-lfte.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<common-standard-layout data=data />
1 change: 1 addition & 0 deletions tenants/all/templates/labpulse-breaking-news.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<common-breaking-news-layout data=data />
1 change: 1 addition & 0 deletions tenants/all/templates/labpulse-community-insider.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<common-insider-layout data=data />
1 change: 1 addition & 0 deletions tenants/all/templates/sab.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<common-standard-layout data=data />

0 comments on commit e25ccbb

Please sign in to comment.