public

This is a Liquid template with access to a Page object and fb_page and fb_user information

  • Download Gist
Example Pagelander Template
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
<div id="fb-root">
<div style="background-color:#FFFFFF; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;min-height:750px;">
<link rel="stylesheet" type="text/css" href="{{page.host_path}}/screen.css" />
<div id="cny-home-expo-01">
<img src="{{page.host_path}}/cny-home-expo_01.gif" width="520" height="109" alt="">
</div>
<div id="cny-home-expo-02">
<img src="{{page.host_path}}/cny-home-expo_02.gif" width="253" height="362" alt="">
</div>
<div id="cny-home-expo-03">
<p id='ajaxMessage'></p>
<form action='http://pagelander.net/contacts' class='contact_form' id='contact_form' method='post' style="display:none;">
<input id='authenticity_token' name='authenticity_token' type='hidden' value='auASX61O/2GGUBJR5maalky7YeQ1QF7vQHR2jo3zeMA=' />
<input id='page_slug' name='page_slug' type='hidden' value='{{page.landing_page_name}}' />
<div class='input'>
<label class='string' for='name'>
Name
</label>
<input name='contact[name]' />
</div>
<div class='input'>
<label class='string' for='email'>
Email
</label>
<input name='contact[email]' />
</div>
<div class='input'>
<label class='string' for='phone'>
Phone
</label>
<input name='contact[phone]' />
</div>
<div class='input'>
<label class='string' for='address'>
Address
</label>
<input name='contact[address]' />
</div>
<div class='input'>
<label class='string' for='city'>
City
</label>
<input name='contact[city]' />
</div>
<div class='input'>
<label class='string' for='state'>
State
</label>
<input name='contact[state]' />
</div>
<div class='input'>
<label class='string' for='zip'>
Zip
</label>
<input name='contact[zip]' />
</div>
<input type='submit' value='Submit' id='submit' />
</form>
<img src="{{page.host_path}}/home-expo_03-fixed.gif" width="267" height="362" alt="" id="unliked_form" style="display:block;">
</div>
<div id="cny-home-expo-04">
<img src="{{page.host_path}}/cny-home-expo_04.gif" width="520" height="229" alt="">
</div>
</div>
</div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type='text/javascript'></script>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: '194661473905020', status: true, cookie: true, xfbml: true, channelUrl: 'http://pagelander.net/facebook/expo'});
FB.getLoginStatus(function(response) {
$('#ajaxMessage').html("<p>Connected to Application</p>").show();
});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
$(document).ready(function(){
if({{fb_page.liked}}){
$('#unliked_form').hide();
$('#contact_form').show();
}
$('#ajaxMessage').hide();
$('#submit').click(function(){
$('#ajaxMessage').html("<p>Submitting your information, please wait...</p>").show();
$.ajax({
type: "POST",
url: "http://pagelander.net/contacts",
data: $('#contact_form').serialize(),
success: function(msg){
$('#ajaxMessage').hide();
$('#contact_form').html("<div id='thank_you' class='thank_you'>"+msg+"</div>")
}
});
});
});
</script>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.