Skip to content

Instantly share code, notes, and snippets.

@onre
Created March 11, 2013 19:59
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 onre/408a2859ab1d8a775fab to your computer and use it in GitHub Desktop.
Save onre/408a2859ab1d8a775fab to your computer and use it in GitHub Desktop.
# mysite/_config.php line
ShortcodeParser::get('default')->register('Sukutaulu',array('Sukuposti','SukutauluShortCodeHandler'));
# mysite/code/Sukuposti.php
class Sukuposti {
public static function SukutauluShortCodeHandler($arguments,$parser = null) {
print_r($arguments);exit;
if (empty($arguments['spnro'])) {
return;
}
$template = new SSViewer('SukupostiSukutaulu');
return $template->process(new ArrayData($arguments));
}
}
# themes/simple/templates/Includes/SukupostiSukutaulu.ss
sukutaulu: $spnro
# the stuff I've input into WYSIWYG editor:
[Sukutaulu spnro=123456]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment