Last active
April 18, 2018 20:39
-
-
Save bookchiq/c8999f66cfbe4d6093c3b37ca312959f to your computer and use it in GitHub Desktop.
P2A Marketo Rich Media adjustments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery( document ).ready( function( $ ) { | |
| var moveMarketoRichMediaAround = function() { | |
| var wrapperClass = '.RTP_RCMD2'; | |
| var pageWidth = $( 'body' ).width(); | |
| var targetSmallScreens = '.default-page-content > .fl-node-content'; | |
| var targetLargeScreens = '.marketo-rich-media > .custom-html-widget'; | |
| if ( 769 <= pageWidth ) { | |
| // It's two-column, so put it in the sidebar widget if it's not already there | |
| if ( 0 === ( $( targetLargeScreens + ' ' + wrapperClass ).length ) ) { | |
| $( wrapperClass ).appendTo( targetLargeScreens ); | |
| } | |
| } else { | |
| // It's one-column, so put it just below the content if it's not already there | |
| if ( 0 === ( $( targetSmallScreens + ' ' + wrapperClass ).length ) ) { | |
| $( wrapperClass ).appendTo( targetSmallScreens ); | |
| } | |
| } | |
| }; | |
| moveMarketoRichMediaAround(); // Initial load | |
| $( window ).resize(function() { | |
| moveMarketoRichMediaAround(); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Marketo Rich Media widget */ | |
| .fl-page .RTP_RCMD2 [data-rtp-id="rtp_rcmd2_tpl_2"] { | |
| padding: 0; | |
| } | |
| .fl-page .RTP_RCMD2 .rtp_rcmd2_title { | |
| border-bottom: 3px solid #67c7c7; | |
| font-weight: 500; | |
| line-height: 1.4; | |
| } | |
| .fl-page .rtp_rcmd2_item { | |
| font-size: 15px; | |
| margin-bottom: 2em; | |
| } | |
| .fl-page .RTP_RCMD2 [data-rtp-id="rtp_rcmd2_tpl_2"] .rtp_rcmd2_label a { | |
| color: #1769bd; | |
| font-size: 17px; | |
| font-weight: 700; | |
| line-height: inherit; | |
| margin-top: 0; | |
| max-height: none; | |
| } | |
| .fl-page .RTP_RCMD2 [data-rtp-id="rtp_rcmd2_tpl_2"] .rtp_rcmd2_description_container { | |
| max-height: none; | |
| } | |
| .fl-page .RTP_RCMD2 [data-rtp-id="rtp_rcmd2_tpl_2"] .rtp_rcmd2_link_container a { | |
| font-size: 17px; | |
| font-weight: 700; | |
| padding-left: 0; | |
| padding-right: 0; | |
| } | |
| /* Mobile devices */ | |
| .default-page-content > .fl-node-content .RTP_RCMD2 { | |
| padding-top: 15px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function(c,h,a,f,i,e){c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; | |
| c[a].a=i;c[a].e=e;var g=h.createElement("script");g.async=true;g.type="text/javascript"; | |
| g.src=f+'?aid='+i;var b=h.getElementsByTagName("script")[0];b.parentNode.insertBefore(g,b); | |
| })(window,document,"rtp","//sjrtp4-cdn.marketo.com/rtp-api/v1/rtp.js","phone2action"); | |
| // Send page view (required by the recommendation) | |
| rtp('send', 'view'); | |
| rtp('get', 'campaign', true); | |
| // Populate recommendation | |
| rtp('get', 'rcmd', 'richmedia'); | |
| rtp('set', 'rcmd', 'richmedia', { | |
| "template2": { | |
| "rcmd.title.text" : "Recommended Reading", | |
| "rcmd.general.font.family" : "'Proxima Nova','Open Sans',Arial,sans-serif", | |
| "rcmd.title.font.family" : "Balboa,'Roboto','Arial Narrow',Arial,sans-serif", // This isn't documented so I'm just being optimistic | |
| "rcmd.title.font.size" : "28px", | |
| "rcmd.title.font.color" : "#0a0a0a", | |
| "rcmd.description.font.color": "#777777", | |
| "rcmd.cta.background.color" : "transparent", | |
| "rcmd.cta.font.color" : "#1669bc", | |
| "rcmd.cta.text" : 'Read More <span class="uabb-next-right-arrow">→</span>' | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment