Skip to content

Instantly share code, notes, and snippets.

@litzinger
litzinger / gist:3381477
Created August 17, 2012 18:46
Dividers in ProForm
{fields}
{if field_name == "Solution_of_Interest_Most_Recent__c"}
{field_options}
{if is_divider}
{!-- If its a divider, and its not the first, then we need to close the previous --}
{if divider_number > 1}
</li>
</ul>
</div><!-- Closing <div class="tooltip noicon contact right padding_bottom_03"> -->
</div><!-- Closing <div class="field"> -->
{exp:query sql="select count(entry_id) as entry_count from exp_channel_titles where author_id = 1"} {entry_count} {/exp:query}
@litzinger
litzinger / index.html
Created August 21, 2012 16:14
Simple Grid
<div class="mod-body mod-rule">
<div class="h-group">
<span class="heading h5">Grid System</span>
</div>
<div class="row row-test">
<div class="col col1">1</div>
<div class="col col1">1</div>
<div class="col col1">1</div>
<div class="col col1">1</div>
<div class="col col1">1</div>
{exp:stash:set_value name="current_page_channel" value="pages"}
{exp:stash:set_value name="show_navigation" value="{page_show_sidebar_nav}"}
{exp:stash:set_value name="navigation_tree" value="{page_sidebar_show_tree}"}
{exp:stash:set_value name="navigation_start_from" value="{page_sidebar_nav_start_from}"}
{exp:stash:set_value name="sidebar_title" value="{page_sidebar_title}"}
{exp:stash:set_value name="sidebar_title_icon" value="{page_sidebar_title_icon}"}
{exp:stash:set_value name="current_page_entry_id" value="{entry_id}"}
<!-- BEGIN: snippets/content/page-banner -->
@litzinger
litzinger / _layouts:page.html
Last active October 10, 2015 20:58
Template partials using Stash in practice
{!-- Basic 2 column template used for generic/most pages --}
{embed="_layouts/two-column"}
{exp:channel:entries
channel="pages"
{global:disabled_params}
{global:transcribe}
{global:tag_cache}}
{exp:stash:set_value name="current_page_channel" value="pages"}
@litzinger
litzinger / mcp.structure.php
Created October 18, 2012 20:54
Structure hook for reordering
// -------------------------------------------
// 'structure_reorder_end' hook.
//
if ($this->EE->extensions->active_hook('structure_reorder_end') === TRUE)
{
$data = $this->EE->extensions->call('structure_reorder_end', $data, $site_pages);
}
//
// -------------------------------------------
@litzinger
litzinger / seo_lite.diff
Created October 21, 2012 23:10
Adding Publisher support to SEO Lite
diff -r seo_lite_orig/tab.seo_lite.php seo_lite/tab.seo_lite.php
32c32,44
< $q = $this->EE->db->get_where('seolite_content', array('entry_id' => $entry_id));
---
> $where = array(
> 'entry_id' => $entry_id,
> 'site_id' => $this->EE->config->item('site_id')
> );
>
> if (isset($this->EE->publisher_lib))
@litzinger
litzinger / pi.suggested.php
Created November 1, 2012 16:44
Suggested Search for ExpressionEngine, good for 404 pages.
## Template code
<h1>Sorry, the page you were looking for was not found.</h1>
<div class="search_results">
{exp:suggested:search channel="pages" status="open" parse="inward"}
{if no_results}
No suggested pages found. Go <a href="{site_url}">Home</a>
{/if}
@litzinger
litzinger / template.html
Created November 12, 2012 18:06
Stash & Pagination
<!-- Use http://devot-ee.com/add-ons/better-pagination for optimal results -->
{embed="layouts/two-column"}
{!-- Set display limit, this is how many will show on each page --}
{if last_segment == "search"}
{preload_replace:pre_limit="10"}
{/if}
{if last_segment != "search"}
@litzinger
litzinger / publisher-hooks.php
Created November 29, 2012 15:07
Hooks from Publisher
// -------------------------------------------
// 'publisher_toolbar_status' hook
// - Let users add to or rename the status labels at will.
//
if ($this->EE->extensions->active_hook('publisher_toolbar_status'))
{
$save_options = $this->EE->extensions->call('publisher_toolbar_status', $save_options);
}
//
// -------------------------------------------