This file contains 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
{% macro excerpt(default, fallback, limit) %} | |
{% if default | length > 0 %} | |
{{ default }} | |
{% else %} | |
{% set fallbackRaw = fallback | striptags %} | |
{% set excerpt = (fallbackRaw | length > 200) ? fallbackRaw | slice(0, 200) ~ '...' : fallbackRaw %} | |
<p>{{ excerpt }}</p> | |
{% endif %} | |
{% endmacro %} |
This file contains 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
/** | |
* Get all locale-specific URLs for a given entry. | |
* | |
* @param Craft\ElementCriteriaModel $entry | |
* @return Array | |
*/ | |
public function getEntryLocaleUrls($entry) | |
{ | |
// get all site locales | |
$localeIds = craft()->i18n->getSiteLocaleIds(); |
This file contains 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
var Iterator = function (collection, options) { | |
var version = 1.1, | |
defaults = { | |
infinite : false | |
}; | |
if (options !== null && typeof options === 'object') for (var key in defaults) | |
if (options.hasOwnProperty(key)) defaults[key] = options[key]; |
This file contains 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
{if layout:paginate_total_pages} | |
<div class="page"> | |
<a | |
{if layout:paginate_previous_page} | |
class="page-previous" href="{layout:paginate_previous_page}" | |
{if:else} | |
class="page-previous disabled" href="#" | |
title="Previous Page"> | |
{/if} |
This file contains 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
{paginate} | |
{pagination_links} | |
{previous_page}{layout:set name="paginate_previous_page" value="{pagination_url}"}{/previous_page} | |
{next_page}{layout:set name="paginate_next_page" value="{pagination_url}"}{/next_page} | |
{layout:set name="paginate_current_page" value="{current_page}"} | |
{layout:set name="paginate_total_pages" value="{total_pages}"} | |
{/pagination_links} | |
{/paginate} |
This file contains 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
{# | |
To start with, all Minimee tags by default run off the settings | |
from the database (via it's plugin settings page), OR | |
from craft/config/minimee.php if you prefer to configure it via the filesystem. | |
Then you can override individual settings, on a per-tag basis, | |
by passing a hash (Twig's name for a key => value array). You can either | |
set this hash first and then pass it, or pass it at the time of the minimee tag call. | |
#} |
This file contains 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
/** | |
* Begin boilerplate plugin code ... | |
* | |
* $this->cache is set up in the __construct(), and is just a reference | |
* to a custom key as part of $this->EE->session->cache, e.g. | |
* $this->cache =& $this->EE->session->cache['myplugin'] = array(); | |
*/ | |
function msm_switch_site() | |
{ |
This file contains 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
# EditorConfig helps developers define and maintain consistent | |
# coding styles between different editors and IDEs | |
# editorconfig.org | |
root = true | |
[*] | |
# Change these settings to your own preference |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
/* ========================================================================== | |
The Grid | |
========================================================================== */ | |
/** | |
* An atomic, BEM-style variable/mixin suite for creating flexible, configurable grids. | |
* | |
* All variables may be overwritten globally, or at runtime via mixin parameters. | |
* | |
* 1. Variables |
OlderNewer