Skip to content

Instantly share code, notes, and snippets.

@qbmarketing
Created August 13, 2013 18:47
Show Gist options
  • Save qbmarketing/6224337 to your computer and use it in GitHub Desktop.
Save qbmarketing/6224337 to your computer and use it in GitHub Desktop.
Current EE template partials approach. The idea is this: each template group has a "pages" channel (just using regular EE entries). The custom field group for "pages" is shared across each template group's pages channel. Within that group, there is a body, list after, and extended body field (along with some SEO fields). The "list after" is a se…
{sn_doc_open}
<div class="row">
<div class="large-9 columns main-content-column">
{exp:stash:get_list name="entry_details" limit="1"}
<h1>{entry_title}</h1>
{entry_body}
{/exp:stash:get_list}
<div class="row">
<div class="large-12 columns text-center">
{exp:stash:get name="next_prev_links"}
</div>
</div>
</div>
<div class="large-3 columns main-sidebar-column">
{exp:stash:get name="section_sidebar"}
</div>
</div>
{sn_doc_close}
{!-- EMBED WRAPPER LAYOUT TEMPLATE --}
{embed="_layouts/.interior"}
{!-- START TEMPLATE LOGIC, STASHING CONTENT FOR USE IN EMBEDDED WRAPPER LAYOUT TEMPLATE --}
{preload_replace:my_main_channel="abtpgs"}
{preload_replace:my_main_channel_prefix="pages"}
{preload_replace:my_main_channel_set="abtpgs"}
{preload_replace:my_main_channel_limit="1"}
{preload_replace:my_main_channel_status="open|Featured"}
{preload_replace:my_main_channel_disable="{lv_template_disable_all}"}
{preload_replace:my_main_channel_cache="yes"}
{preload_replace:my_main_channel_refresh="120"}
{preload_replace:my_main_channel_dynamic="yes"}
{preload_replace:my_main_channel_require_entry="yes"}
{preload_replace:my_sidebar_channel="abtpgs"}
{preload_replace:my_sidebar_channel_prefix="pages"}
{preload_replace:my_sidebar_channel_set="abtpgs"}
{preload_replace:my_sidebar_channel_limit="40"}
{preload_replace:my_sidebar_channel_status="open|Featured"}
{preload_replace:my_sidebar_channel_disable="{lv_template_disable_all}"}
{preload_replace:my_sidebar_channel_cache="yes"}
{preload_replace:my_sidebar_channel_refresh="120"}
{preload_replace:my_sidebar_channel_dynamic="no"}
{preload_replace:my_sidebar_channel_require_entry="yes"}
{exp:stash:set_list name="entry_details" parse_tags="yes" scope="site" save="yes" limit="1"}
{exp:low_reorder:entries set="{my_main_channel_set}" limit="{my_main_channel_limit}" status="{my_main_channel_status}" disable="{my_main_channel_disable}" cache="{my_main_channel_cache}" refresh="{my_main_channel_refresh}" dynamic="{my_main_channel_dynamic}"{if segment_2} url_title="{segment_2}"{/if}}
{if no_results}
{redirect="404"}
{/if}
{stash:entry_seo_title}{exp:ifelse parse="inward"}{if cf_{my_main_channel_prefix}_seo_title}{cf_{my_main_channel_prefix}_seo_title}{if:else}{title}{/if}{/exp:ifelse}{/stash:entry_seo_title}
{stash:entry_seo_description}{exp:ifelse parse="inward"}{if cf_{my_main_channel_prefix}_seo_description}{cf_{my_main_channel_prefix}_seo_description}{if:else}{lv_settings_default_seo_description}{/if}{/exp:ifelse}{/stash:entry_seo_description}
{stash:entry_seo_keywords}{exp:ifelse parse="inward"}{if cf_{my_main_channel_prefix}_seo_keywords}{cf_{my_main_channel_prefix}_seo_keywords}{if:else}{lv_settings_default_seo_keywords}{/if}{/exp:ifelse}{/stash:entry_seo_keywords}
{stash:entry_title}{title}{/stash:entry_title}
{stash:entry_body}
{cf_{my_main_channel_prefix}_body}
{sn_list_after_logic}
{if cf_{my_main_channel_prefix}_extended_body}{cf_{my_main_channel_prefix}_extended_body}{/if}
{/stash:entry_body}
{/exp:low_reorder:entries}
{/exp:stash:set_list}
{exp:stash:set name="section_sidebar" parse_tags="yes" scope="site" save="yes"}
{sn_section_pages_menu}
{/exp:stash:set}
<div class="footer">
<div class="row">
<div class="large-12 columns">
<ul class="inline-list">
<li{if segment_1 == "help"} class="active"{/if}><a href="{path='help'}">Help</a></li>
<li{if segment_1 == "news"} class="active"{/if}><a href="{path='news'}">News</a></li>
<li{if segment_1 == "riding"} class="active"{/if}><a href="{path='riding'}">Riding</a></li>
<li{if segment_1 == "about"} class="active"{/if}><a href="{path='about'}">About</a></li>
<li{if segment_1 == "donate"} class="active"{/if}><a href="{path='donate'}">Donate</a></li>
</ul>
<ul class="inline-list copyright">
<li>Copyright {current_time format="%Y"} {exp:low_variables:single var="lv_settings_site_name"}</li>
<li>All rights reserved.</li>
<li><a href="#" data-reveal-id="privacyModal">Privacy Policy</a></li>
</ul>
</div>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
if (typeof jQuery == 'undefined') {
document.write(unescape("%3Cscript src='/js/vendor/jquery.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>
<script src="/js/foundation/foundation.min.js"></script>
<script src="/js/vendor/respond.min.js"></script>
{exp:switchee parse="inward" variable="{segment_1}"}
{case value=""}
USE SWITCH CASE TO LOAD ANY JS THAT IS ONLY NEEDED WITHIN A SPECIFIC TEMPLATE GROUP
{/case}
{/exp:switchee}
<script>
$(document).foundation();
</script>
{exp:low_variables:single var="lv_settings_google_analytics"}
</body>
</html>
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
{exp:stash:get_list name="entry_details" limit="1"}
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<meta name="description" content="{entry_seo_description}" />
<meta name="keywords" content="{entry_seo_keywords}" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
{!-- Facebook Metadata --}
<meta property="og:title" content="{entry_seo_title} | {exp:low_variables:single var="lv_settings_site_name"}"/>
<meta property="og:description" content="{entry_seo_description}"/>
<meta property="og:image" content="" />
<meta property="fb:page_id" content="" />
{!-- Google+ Metadata --}
<meta itemprop="name" content="{entry_seo_title} | {exp:low_variables:single var="lv_settings_site_name"}">
<meta itemprop="description" content="{entry_seo_description}">
<meta itemprop="image" content="">
<title>{entry_seo_title} | {if the_section_name != ""}{the_section_name} |{/if} {exp:low_variables:single var="lv_settings_site_name"}</title>
{/exp:stash:get_list}
{exp:minimee:css}
<link rel="stylesheet" type="text/css" href="/css/normalize.css" />
<link rel="stylesheet" type="text/css" href="/css/foundation.min.css" />
<link rel="stylesheet" type="text/css" href="/css/royalslider.css">
<link rel="stylesheet" type="text/css" href="/css/override.css" />
<link rel="stylesheet" type="text/css" href="/css/skins/minimal-white/rs-minimal-white.css">
<link rel="stylesheet" type="text/css" href="/css/jquery.fancybox.css?v=2.1.5" media="screen" />
{/exp:minimee:css}
<link rel="apple-touch-icon" href="/images/interface/touchicon.png">
<link rel="icon" href="path/to/favicon.png">
<!--[if IE]><link rel="shortcut icon" href="/images/interface/favicon.ico"><![endif]-->
<!-- or, set /favicon.ico for IE10 win -->
<meta name="msapplication-TileColor" content="#bb0303">
<meta name="msapplication-TileImage" content="/images/interface/tileicon.png">
<script src="/js/vendor/custom.modernizr.js"></script>
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="/css/ie8-grid-foundation-4.css" />
<![endif]-->
</head>
<body class="{segment_1}">
<div class="fixed contain-to-grid">
<nav class="top-bar">
<ul class="title-area">
{!-- Title Area --}
<li class="name">
<a href="{path='home'}">
<img src="/images/interface/kr_logo.png" width="240" height="60" alt="{exp:low_variables:single var="lv_settings_site_name"}" />
</a>
</li>
<li class="toggle-topbar menu-icon"><a href="#"><span>menu</span></a></li>
</ul>
<section class="top-bar-section">
{!-- Right Nav Section --}
<ul class="right">
{exp:low_reorder:entries set="helppgs" limit="40" cache="yes" refresh="360" disable="{lv_template_disable_all}" dynamic="no"}
{if count == "1"}<li class="{if segment_1 == "help"}active {/if}{if total_results > "1"}has-dropdown{/if}"><a href="{path='help'}">Help</a>{/if}
{if total_results > "1"}
{if count == "1"}<ul class="dropdown">{/if}
<li><a href="{exp:ifelse parse="inward"}{if count == "1"}{path='help'}{if:else}{url_title_path='help'}{/if}{/exp:ifelse}">{exp:ifelse parse="inward"}{if cf_pages_alt_menu_title}{cf_pages_alt_menu_title}{if:else}{title}{/if}{/exp:ifelse}</a></li>
{if count == total_results}</ul>{/if}
{/if}
{if count == total_results}</li>{/if}
{/exp:low_reorder:entries}
<li{if segment_1 == "news"} class="active"{/if}><a href="{path='news'}">News</a></li>
<li{if segment_1 == "riding"} class="active"{/if}><a href="{path='riding'}">Riding</a></li>
{exp:low_reorder:entries set="abtpgs" limit="40" cache="yes" refresh="360" disable="{lv_template_disable_all}" dynamic="no"}
{if count == "1"}<li class="{if segment_1 == "about"}active {/if}{if total_results > "1"}has-dropdown{/if}"><a href="{path='about'}">About</a>{/if}
{if total_results > "1"}
{if count == "1"}<ul class="dropdown">{/if}
<li><a href="{exp:ifelse parse="inward"}{if count == "1"}{path='about'}{if:else}{url_title_path='about'}{/if}{/exp:ifelse}">{exp:ifelse parse="inward"}{if cf_pages_alt_menu_title}{cf_pages_alt_menu_title}{if:else}{title}{/if}{/exp:ifelse}</a></li>
{if count == total_results}</ul>{/if}
{/if}
{if count == total_results}</li>{/if}
{/exp:low_reorder:entries}
{exp:low_reorder:entries set="donpgs" limit="40" cache="yes" refresh="360" disable="{lv_template_disable_all}" dynamic="no"}
{if count == "1"}<li class="{if segment_1 == "donate"}active {/if}{if total_results > "1"}has-dropdown{/if}"><a href="{path='donate'}">Donate</a>{/if}
{if total_results > "1"}
{if count == "1"}<ul class="dropdown">{/if}
<li><a href="{exp:ifelse parse="inward"}{if count == "1"}{path='donate'}{if:else}{url_title_path='donate'}{/if}{/exp:ifelse}">{exp:ifelse parse="inward"}{if cf_pages_alt_menu_title}{cf_pages_alt_menu_title}{if:else}{title}{/if}{/exp:ifelse}</a></li>
{if count == total_results}</ul>{/if}
{/if}
{if count == total_results}</li>{/if}
{/exp:low_reorder:entries}
</ul>
</section>
</nav>
</div>{!-- /.fixed.contain-to-grid --}
{exp:switchee variable="{cf_{my_main_channel_prefix}_list_after}" parse="inward"}
{case value="none" default="yes"}{/case}
{case value="news"}<div class="list-after">{embed="_embeds/.news_list"}</div>{/case}
{case value="help"}<div class="list-after">{embed="_embeds/.help_ways_list"}</div>{/case}
{case value="sign"}<div class="list-after">{embed="_embeds/.help_sign_form"}</div>{/case}
{case value="volunteer"}<div class="list-after">{embed="_embeds/.help_volunteer_form"}</div>{/case}
{case value="vote"}<div class="list-after">{embed="_embeds/.help_vote_info"}</div>{/case}
{case value="social"}<div class="list-after">{embed="_embeds/.help_social_info"}</div>{/case}
{case value="host"}<div class="list-after">{embed="_embeds/.help_host_form"}</div>{/case}
{case value="form"}<div class="list-after">{embed="_embeds/.help_contact_form"}</div>{/case}
{case value="testimonial"}<div class="list-after">{embed="_embeds/.help_testimonial_form"}</div>{/case}
{case value="big_map"}<div class="list-after">{embed="_embeds/.riding_big_map"}</div>{/case}
{case value="quotes"}<div class="list-after">{embed="_embeds/.about_quotes_list"}</div>{/case}
{case value="donate"}<div class="list-after">{embed="_embeds/.donate_options_list"}</div>{/case}
{/exp:switchee}
{exp:low_reorder:entries set="{my_sidebar_channel_set}" limit="{my_sidebar_channel_limit}" status="{my_sidebar_channel_status}" disable="{my_sidebar_channel_disable}" cache="{my_sidebar_channel_cache}" refresh="{my_sidebar_channel_refresh}" dynamic="{my_sidebar_channel_dynamic}"}
{if count == "1"}<ul class="side-nav">{/if}
<li{if count == "1" AND segment_2 == ""} class="active"{/if}{if segment_2 == url_title} class="active"{/if}><a href="{exp:ifelse parse="inward"}{if count == "1"}{path='{segment_1}'}{if:else}{url_title_path='{segment_1}'}{/if}{/exp:ifelse}">{exp:ifelse parse="inward"}{if cf_{my_sidebar_channel_prefix}_alt_menu_title}{cf_{my_sidebar_channel_prefix}_alt_menu_title}{if:else}{title}{/if}{/exp:ifelse}</a></li>
{if count == total_results}</ul>{/if}
{/exp:low_reorder:entries}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment