Hi
I have been reading this thread (#9) (
http://modxcms.com/forums/index.php/topic,31097.0.html) about adding a template option to Tinymce in order to have content repeat in the content area (i want an image to the left at a set width with text floated to the right in set width) which sounds incredibly useful.
I have got as far as adding the template option to the tinymce options but can’t see my template in the drop down options.
I have added the following to tinymce.functions.php at line 202 as stated in the aforementioned thread:
$tinymceInit .= " template_templates : [
{ title : \"Images - single\", src : \"/assets/templates/left-right.html\", description : \"Add single image + caption \" },
]".",\n";
My html template simply contains a couple of basic div tags..no head or body tags..is this correct?
Is the above code pasted into the correct place?
The entire code block with my addition looks like this (my addition in red):
function build_tiny_callback($params)
{
$ph['cmsurl'] = MODX_BASE_URL . 'manager/media/browser/mcpuk/browser.php?Connector=';
$ph['cmsurl'] .= MODX_BASE_URL . 'manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath=';
[color=red]$tinymceInit .= " template_templates : [
{ title : \"Images - single\", src : \"../assets/templates/left-right.html\", description : \"Add single image + caption \" },
]".",\n";[/color]
$ph['cmsurl'] .= MODX_BASE_URL . '&editor=tinymce&editorpath=' . $params['mce_url'];
$modx_fb = file_get_contents($params['mce_path'] . 'js/modx_fb.js.inc');
foreach($ph as $name => $value)
{
$name = '[+' . $name . '+]';
$modx_fb = str_replace($name, $value, $modx_fb);
}
return $modx_fb;
}
Can anyone help with this as it would be such a useful addition?
Thanks
J