I got it work. I dont know if this is the "Right way" to do that , while you have to change "umbraco.controllers.js" inside "Umbraco/Js/" but it is work. :) As i say - I'm pretty sure it isn't the "Right way".. but for now it's seems like the "umbraco.controllers.js" doesn't do anything with the <customConfig> section.
@Gilad - Must the templates be saved to a specific folder in order to be picked up? I'm using 7.1.1 and have followed the original guidelines from the old wiki - The template icon is added but when I click it in the rich text editor I just get a message saying "no templates defined".
Not sure where it looks for the template but I have just placed my template in the /config/ folder for now...
Just try this on 7.1.1 Maybe there is way to do it through the <customConfig> only, but i can't find it yet. Meanwhile, i mange to get it work like this:
"/Umbraco/Js/umbraco.controllers.js" - on row 5383, Befor : if(tinyMceConfig.customConfig){ Add this:
if (tinyMceConfig.customConfig.templates) { tinyMceConfig.customConfig.templates = JSON.parse(tinyMceConfig.customConfig.templates); }
Then, change your config under <customConfig> on tinyMceConfig.config like this :
Thanks for your answer. Will give it a go tomorrow at work.
In regards to the path...is /editorTemplate/ just a folder you're using as an example or does it exist in the file system somewhere? I'm in doubt about wether I could just reference any folder I'd like to be honest.
[
{"title": "Some title 1", "description": "Some desc 1", "content": "My content"},
{"title": "Some title 2", "description": "Some desc 2", "url": "/App_Plugins/TinyMceTemplates/development.html"}
]
into /App_Plugins/TinyMceTemplates/templates-config.html
This worked for me and I didn't have to make any changes to the controller. Plus, you don't have to touch web.config every time you make a change or add a template.
Thanks for that tip - I'm going to try it out as well.
So is this really all you did to enable the templates in tinyMce? Once the templates-config.html file is in place you did not have to do anything else?
Ok, I used nik's solution on two 7.1.4 sites successfully, but it seems this changes for almost each new version at the moment!?! In 7.1.5 I get the the icon on the editor, on hover it presents the right tool tip, on click however, nothing happens... Anyone know how to do it in Umbraco 7.1.5? Or anyone know that this method should work in 7.1.5?
How to add tinymce Templates in v7
Hi gurus,
How can I add templates in tinymce in umbraco v7? I tried the post from here: http://our.umbraco.org/wiki/how-tos/enabling-the-'template'-plugin-for-tinymce it works in v6 but not in v7 anymore.
Hope you can provide a tutorial or some help in attaining this goal. Thanks in advance.
Cheers,
Allan
Hello Allan.
I got it work.
I dont know if this is the "Right way" to do that , while you have to change "umbraco.controllers.js" inside "Umbraco/Js/"
but it is work. :)
As i say - I'm pretty sure it isn't the "Right way".. but for now it's seems like the "umbraco.controllers.js" doesn't do anything with the <customConfig> section.
Here's what i do :
1) Like the description in the post : http://our.umbraco.org/wiki/how-tos/enabling-the-'template'-plugin-for-tinymce
Open "/config/tinyMceConfig.config" and add the following sections.
Add this to <commands> ( only change the icon url becuse 'templae.gif' isn't there )
Add this to <plugins>
Add this to <customConfig> ( Here you have to change the structure + the 'src' to 'url' + you must set the key to 'tempaltes')
2) Open "/Umbraco/Js/umbraco.controllers.js" and add the following
On row 4764 after:
"tinyMceService.configuration().then(function(tinyMceConfig){"
add this :
On row 4836 ( tinymce init function) - "tinymce.init({.... "
add this to the function object
It should look like this:
Hope that help,
Cheers.
And dont forget to
"Recycle application pool / touch web.config to see the changes in the tinyMceConfig.config propogated."
I was also surprised to find the templates functionality no longer worked in v7.
Potentially resolved in 7.1, although I've not had a chance to test the beta yet.
http://issues.umbraco.org/issue/U4-4031
@Gilad - Must the templates be saved to a specific folder in order to be picked up? I'm using 7.1.1 and have followed the original guidelines from the old wiki - The template icon is added but when I click it in the rich text editor I just get a message saying "no templates defined".
Not sure where it looks for the template but I have just placed my template in the /config/ folder for now...
My configuration is like this
Command
Plugins
Custom config - The tricky part where something is perhaps wrong, or not supported by the core.
Does anyone know if I need to change something in the configuration? Perhaps I should just submit a bug but would like checking before doing so.
Cheers, Jan
Hi Jan.
Just try this on 7.1.1
Maybe there is way to do it through the <customConfig> only, but i can't find it yet.
Meanwhile, i mange to get it work like this:
"/Umbraco/Js/umbraco.controllers.js" - on row 5383,
Befor : if(tinyMceConfig.customConfig){
Add this:
Then, change your config under <customConfig> on tinyMceConfig.config like this :
Hi Gilad
Thanks for your answer. Will give it a go tomorrow at work.
In regards to the path...is /editorTemplate/ just a folder you're using as an example or does it exist in the file system somewhere? I'm in doubt about wether I could just reference any folder I'd like to be honest.
Cheers, Jan
Hi Jan.
The path is for the example.
Cheers
Hi Gilad
Awesome! Got it working now...Think I'll create a pull request for this change :)
Cheers, Jan
Hi Gilad...
One more question though...how would you enable the options to for instance manage with and height on the template window? as listed here http://www.tinymce.com/wiki.php/Plugin:template
/Jan
Hi Gilad,
I tried your solution in v7.1.2 but I'm having this error:
http://localhost/umbraco/[%7B%20%20%20%20%20%20%20%20%20%20%20%20%22title%22%20:%20%22Two%20Columns%22,%20%20%20%20%20%20%20%20%20%20%20%20%22url%22%20%20%20:%20%22/templates/twocol.html%22,%20%20%20%20%20%20%20%20%20%20%20%20%22description%22%20:%20%22Two%20Column%20Layout%22%20%20%20%20%20%20%20%20%20%20%7D]
Below if my settings:
CustomConfig
In /Umbraco/Js/umbraco.controllers.js file
I add this in line 5457 after angular.extend(baseLineConfigObj, tinyMceConfig.customConfig)
Regards,
Allan
Allan, I had the same problem in 7.1.3 and found that the <config key="templates"> is expecting a URL to a config value. I updated it to be
And then dropped
into /App_Plugins/TinyMceTemplates/templates-config.html
This worked for me and I didn't have to make any changes to the controller. Plus, you don't have to touch web.config every time you make a change or add a template.
Hi Nik
Thanks for that tip - I'm going to try it out as well.
So is this really all you did to enable the templates in tinyMce? Once the templates-config.html file is in place you did not have to do anything else?
/Jan
Thank you nik! Was completely pulling my hair out with this one on v7.1.4!
Ok, I used nik's solution on two 7.1.4 sites successfully, but it seems this changes for almost each new version at the moment!?! In 7.1.5 I get the the icon on the editor, on hover it presents the right tool tip, on click however, nothing happens... Anyone know how to do it in Umbraco 7.1.5? Or anyone know that this method should work in 7.1.5?
All of the contributions on this thread helped get me going! Thanks to all of you :-)
this worked for me with 7.11.1 https://www.wiliam.com.au/wiliam-blog/adding-enhanced-styling-to-the-umbraco-tinymce-editor no need to change anything in the controllers.js however i had to enable the Templates toolbar icon in the Richtext editor Data Type to make it visible in the interface
is working on a reply...