Hi guys,
I've been playing around with custom shortcodes to be able to make column layouts in the TinyMCE editor. So far I've got everything working nicely, but I've run into one problem and I'm having a hard time find any answers on resolving it. It seems that any site links inside my shortcode end up being broken. The link ends up looking something like this: www.mysite.com/[sitetree_link,id=3]. I read in the documentation that shortcodes can't be nested, so I'm wondering if that is what's causing the page link shortcode to break... If anyone knows a workaround for this it would be greatly appreciated!
Here is the code I've got so far:
Page.php
public static function TwoColumnShortCodeHandler($arguments, $content = null, $parser = null) {
$customise = array();
$customise['content'] = $content;
$customise = array_merge($customise,$arguments);
$template = new SSViewer('TwoColumn');
return $template->process(new ArrayData($customise));
}
_config.php
ShortcodeParser::get('default')->register('TwoColumn', array('Page', 'TwoColumnShortCodeHandler'));
TwoColumn.ss
<div class="two-column">$content</div>
Cheers,
Ryan