Skip to content

Instantly share code, notes, and snippets.

@kinglozzer
Created November 22, 2016 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kinglozzer/3f4861efd6b9f54401b6763fc9a9a0e8 to your computer and use it in GitHub Desktop.
Save kinglozzer/3f4861efd6b9f54401b6763fc9a9a0e8 to your computer and use it in GitHub Desktop.
<?php
public static function ShortCodeItemBlocks($arguments, $content = null, $parser = null, $tagname) {
$page = Controller::curr()->data();
$itemBlocks = $page->ItemBlocks();
if (isset($arguments['classgroup'])) {
$itemBlocks = $itemBlocks->filter('ClassGroup', $arguments['classgroup']);
}
$data = ArrayData::create(array(
'ItemBlocks' => $itemBlocks,
'Size' => (isset($arguments['size']) ? $arguments['size'] : null,
'CC' => (isset($arguments['customclass']) ? $arguments['customclass'] : null
));
return $data->renderWith(array('ItemBlocks'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment