Re: Responsive Marketo Landing Pages - Solution

Anonymous
Not applicable
I've alluded to this in other places, such as some LinkedIn Marketo groups, but I've been working on some responsive Marketo landing page templates for the past two weeks. Well, it works!

Because everyone loves results, go check out our example of a responsive Marketo landing page: http://resources.yesler.com/responsive-marketo-landing-page-template.html.

That is a responsive landing page that we created in Marketo. Templates (one tokenized and pretty solidified in design, one responsive blank template) are included, with some short documentation on how to do it. Also included are all of the assets, which just need to be hosted on an external server and referenced. This is all coded in LESS, for you developers. Flat UI design and Twitter Bootstrap included.

I've been writing up some posts on how to make responsive LPs, still through the Marketo editor. Here's a link to a very succinct technical summary for web developers.

The two ways responsive design has been disallowed:
  1. No CSS.
  2. No DOM control.

Having CSS control: 
  • First off, the referenced templates strip out all the unnecessary CSS.
  • The element name is the containing div's class. Our solution is to name elements based on what you want them to do. Included classes that override the absolute positioning are: "posOverride," "posOverrideRight," and "posOverrideFull." Respectively, elements with these names will float left, float right, or float left with 100% width. 
Having DOM control:
  • The order in which elements are created in the Marketo editor is the order in which they appear in the HTML. That's more DOM control than you thought. If you're careful about the order you're creating elements, you can make the HTML in the appropriate order.
  • The Marketo Double Div method: create your own DOM with HTML elements, wrapped in closing and opening div tags. I wrote a blog post about how to do this, and it's also described in the documentation for the templates. With some creative HTML element coding, you can wrap other elements right where you want them, meaning you get responsive AND all your dynamic snippets and content.

More details and information are available on my Marketo blog. Feel free to comment, add suggestions and feedback on this page


Best Regards,
Edward Unthank
Marketing Operations Specialist
Yesler
Tags (1)
18 REPLIES 18
Anonymous
Not applicable
Edward,

i am trying to use you LP code.
i cant get the elements to stack properly.
 http://pages.pyramidanalytics.com/Gartner-Temp_Gartner-Newsletter-v2.html
i want the form under the image.

all three elements are posOverride

please let me know

 
Anonymous
Not applicable
 Elliot Lowe, if you use gravity forms plugin there is an addon for marketo. that way you dont need to iframe the forms into the page...
 
Brice_Dunwoodie
Level 4
Hi all,

I've posted a simple example here:
http://www2.simplermedia.com/marketo-responsive-landing-page.html

This is still pretty quick and dirty, but it works and should make our process fairly easy to understand.

Feedback welcome.

-Brice
Brice_Dunwoodie
Level 4
Hi Elliot and Jason,

I can't post the prototype here as it's client specific. I'll post something once I have a generic page for review.

thanks,
Brice
Anonymous
Not applicable
Would also be interesting in seeing this.
Anonymous
Not applicable
Thanks Brice, Can you post a link to a prototype LP where you've used this technique?
Brice_Dunwoodie
Level 4
I've been looking at this post and the related templates for a a few hours and I feel like there's an easier and less brittle way to arrive at responsive landing pages.

No doubt, it's a shame that in 2014 we have to hack Marketo to get mobile friendly landing pages, but here we are. 😞

My approach is to create a simple, clean boostrap template that renders via Marketo. I name (with IDs) a few containers where I want the Marketo components (e.g., text, form) to render. Then I establish a naming convention, (this is brittle, but we need some way to bind). Then when the page loads, I use jQuery to grab the marketo elements and move them into their proper places in the responsive grid.

Here's the jQuery and naming convention that I've tested:
<script>
$(document).ready(function() {
$('#containerHeader').append($('div.txtH1 span.lpContentsItem'));
$('#containerHeader').append($('div.txtH2 span.lpContentsItem'));
$('#containerBody').append($('div.txtBody span.lpContentsItem'));
$('#containerForm').append($('div.objForm span.formSpan'));
});
</script>

Once the jQuery runs, voila, you've got a responsive landing page.

I've implemented this quickly and it seems to work just fine. I have not tested this with Forms 2.0 yet, nor have I gotten far enough so that I'm comfortable putting this into production, but from what I can see, this is a simpler way to skin the cat, and it requires less technical skills (no Marketo Double Div) to create the landing pages, once the template is defined.

Barring a better answer, this is how we're going to make our landing page responsive.

-Brice
Anonymous
Not applicable
Edward, we are implementing a new website in Wordpress whose pages are responsive; however, the Marketo landing page with a form 1.0 that is displayed in an iframe on our website page is not responsive.  In other words the field labels don't wrap from being to the left of the field when the window is wide to being on top of the field when the window is narrow as does the form in your Responsive Marketo Landing Page Templates page,

Can we use the double-div technique with the landing page that is displayed in the iframe to make the form responsive on our web page?  Does this work with forms 1.0, 2.0 or both?



 
Anonymous
Not applicable
Colin:

That's correct. It goes something like this Haiku:

Static template code

[Bring in LP elements]

Static template code


Each WYSIWYG element gets thrown into some backend PHP functions to convert them into HTML. Each element is wrapped in two divs, which is where the absolute positioning comes from. The elements are just returned in the order of their creation, and they're all siblings. 

The "Bring in LP elements" piece is just a PHP echo (<?php echo $mContext['bodyElements']; ?>), which echoes all the resulting HTML of the WYSIWYG editor.

And no, there's no way to HTML-code the Marketo form within an HTML element. You can create your own DOM using the double-div HTML blocks, though!


Cheers,
Edward Unthank
Marketing Operations Specialist
Yesler

Anonymous
Not applicable
Hey Edward,

Given this method, this means that all the elements you add at the Page Editor level have to share a common DOM parent, correct? One common wrapper for the whole layout? There's no way to embed a form within one of these double div HTML blocks, is there? I want to make sure I'm not further handcuffing myself.

Colin McClure
Web Developer
Simply Measured
Anonymous
Not applicable
Hi Nichole:

That would be Reachforce. It fills in appropriate demographic data for the company upon submission as well!


Best,
Edward Unthank
Marketing Operations Specialist
Yesler
Anonymous
Not applicable
Thanks for the form!  I was wondering if you could share what technology you use in the company search that brings up the list of possible companies - really neat.

Anonymous
Not applicable
Hi Peter:

The discussion you're referencing is regarding emails in Marketo, not landing pages. They work a little bit differently--the class="mktEditable" in emails designated blocks that can be edited. In landing pages, this is accomplished through the entire body being "mktEditable" and then dragging in different elements. 

For adding any and all elements, you can use the Double Div method that I wrote about. It does make the WYSIWYG a bit more nuanced to use in achieving this, but it brings in the possibility of using native Marketo dynamic content in the editor. The short version of how to do it is to drag in HTML elements and create your own code structure to wrap those dynamic pieces of content.

When we have complicated landing pages with dynamic content and non-web-developers need ot change/recreate/clone, we can have someone technical put placeholders in the WYSIWYG, then the other Marketo users can clone the landing page and simply replace the elements (such as replacing the picture, editing the rich text content, changing the form, etc.). 


Best,
Edward Unthank
Marketing Operations Specialist
Yesler
Anonymous
Not applicable
Much appreciated, Edward. Just starting out here, but is there a quick answer to the question: With your pattern, is it still as easy as suggested in this thread to add the hook class="mktEditable" to any and all elements that we wish for Marketers to be able to edit text for in the WYSIWYG? Or does your method subvert the WYSIWYG?

Peter
Anonymous
Not applicable
Thanks Edward!
Anonymous
Not applicable
Appreciate this!
Anthony_Pica
Level 4
Wow, thank you!
Anonymous
Not applicable
Very cool!  Thank you for sharing!