Can anybody tell me how can I use dictionary in RTE? For example, how I can add a button which will open the right hand dialog box to choose and insert dictionary item? Any ideas? Or maybe there is already solution?
What is your scenario? Could you explain why you need to be able to insert a dictionary item into the rich text editor?
What is your site setup in Umbraco etc.
Currently, to my knowledge, there is no way of doing it the way you describe.
I added a new button to RTE (http://our.umbraco.org/forum/developers/extending-umbraco/53150-How-to-add-custom-button-to-RTE) where on click opening right dialog box with custom template:
tinymce.PluginManager.add('umbdictionarykey', function (editor) {
editor.addButton('umbdictionarykey', {
icon: 'custom icon-book-alt',
tooltip: 'Insert Dictionary Key',
onclick: function () {
var injector = angular.element(document.getElementById("umbracoMainPageBody")).injector();
var dialogService = injector.get("dialogService");
i managed to get this working using a script that runs everything is reneded - finds rich text fields which i have defined and replaces them with dictionary objects if they have a certain tag around them.
Thanks for helping,
Maybe dictionary objects need to be added to umbraco as a core function.
This is quite interesting.. May I know how is the property RTEDictionary works, is the contents feeding from Settings->Dictionary? Would be interested to find out how to make it read from a fixed CMS node - one which users create and maintaing (with no access to Settings)
In any case it would be highly appreciated if you can share the source of the RTEDictionary App_plugin, I might learn a lot from that example.
Thank you for posting your code. I implemented your plugin, the only change I had to make was to the sql statement in GetDictionaryItems within DictionaryController.cs file
"SELECT distinct d.[key], d.id FROM [dbo].[cmsDictionary] d join [umbraco_dotMailer_v7].[dbo].[cmsLanguageText] lt on lt.UniqueId = d.id")
I Had to remove [umbraco_dotMailer_v7]. so sql became:
"SELECT distinct d.[key], d.id FROM [dbo].[cmsDictionary] d join [dbo].[cmsLanguageText] lt on lt.UniqueId = d.id")
May I know if you have to do anything specific for the api portion to run?
When I install the plugin, add tinymce plugin and update tinymce.config, it shows in tinymce and when i click it opens the panel with two drop downs in it but page gives the following two red notifications below; (I assume the /umbraco/backoffice/rteDictionary/dictionary/GetLanguages api url gets registered by the line 19 where it reads [PluginController("rteDictionary")] ? Or is there something else that needs to be enabled for this API to be activated?
Request error: The URL returned a 404 (not found): /umbraco/backoffice/rteDictionary/dictionary/GetLanguages
Request error: The URL returned a 404 (not found): /umbraco/backoffice/rteDictionary/dictionary/GetDictionaryItems
I followed the exact structure that Oleg has in his git repository (see below).
App_Plugins
DictionaryRTE
api
DictionaryController.cs
model
ItemDictionary.cs
Language.cs
dictionary.controller.js
dictionarylist.html
package.manifest
The only change I made was the one I mentioned above in DictionaryController.cs. So long as you have the correct structure it should work.
Thanks for the reply. I have done exactly that, (and also incorporated your update on the SQL) copy DictionaryRTE under App_Plugins in its entirety. Using 7.1.6.
But for some reason when I click the button in RTE and sidepanel opens up with two dropdowns, i get the 2 red notifications that the URL for the webapi are 404.
I havent used this before so not sure if I need to enable something for the webApi to work?
If I try to open the URL on its own in a browser like
The only other thing I did was build my VS project as I have it set up as a web application not a web site.
I didn't make any other changes specifically for this plugin.
I have had those 404 errors in the past on my own plugin and found it was due to a javascript error.
BTW, how did you copy the files from github? Did you download the zip file or copy the files manually? If you copied them manually, you need to click on the Raw button for each file and then save that page. Right mouse-clicking the link and choosing 'save link as' will give you an HTML page. I did this once by mistake!
@Vasia Vasia, hi, I need to add a place holder text inside an RTE, the place holder text need to be configurated like dropdown values, so I want to place my drop down and inside the RTE and place the place holder text from the drop-down value.
I go throw the blow, You added the button inside RTE right, I tried to follow the same way, But I have few questions.
How to use dictionary in RTE?
Hi everybody,
Can anybody tell me how can I use dictionary in RTE? For example, how I can add a button which will open the right hand dialog box to choose and insert dictionary item? Any ideas? Or maybe there is already solution?
Thank you, Oleg
Hi Oleg
What is your scenario? Could you explain why you need to be able to insert a dictionary item into the rich text editor? What is your site setup in Umbraco etc.
Currently, to my knowledge, there is no way of doing it the way you describe.
Looking forward to hearing from you.
/Jan
Hi Jan,
Thank you for response. Actually, It is client's requirement to have this possibility.
Anyway, I have solved this issue. I have written a small plugin which allows to do it. Now I have it.
Best, Oleg
Hi Oleg,
I would love to know how you got the dictionary plugin to work?
I've been trying to creat something like this for about a week now and nothing...
Thanks
Chris
Hi Chris,
What exactly you can't do?
I added a new button to RTE (http://our.umbraco.org/forum/developers/extending-umbraco/53150-How-to-add-custom-button-to-RTE) where on click opening right dialog box with custom template:
Then you need to create custom plugin where from DB you can get everything you needed.
Let me know if any questions.
Thanks, Oleg
Hi Oleg,
i managed to get this working using a script that runs everything is reneded - finds rich text fields which i have defined and replaces them with dictionary objects if they have a certain tag around them.
Thanks for helping,
Maybe dictionary objects need to be added to umbraco as a core function.
Chris
Hi Oleg
This is quite interesting.. May I know how is the property RTEDictionary works, is the contents feeding from Settings->Dictionary? Would be interested to find out how to make it read from a fixed CMS node - one which users create and maintaing (with no access to Settings)
In any case it would be highly appreciated if you can share the source of the RTEDictionary App_plugin, I might learn a lot from that example.
cheers!
Hi Guys,
Sorry for my late replay.
You can find the source code here: https://github.com/oleg-v/DictionaryRTE_plugin_umbraco.git
Thanks, Oleg
Hi Oleg,
Thank you for posting your code. I implemented your plugin, the only change I had to make was to the sql statement in GetDictionaryItems within DictionaryController.cs file
I Had to remove [umbraco_dotMailer_v7]. so sql became:
"SELECT distinct d.[key], d.id FROM [dbo].[cmsDictionary] d join [dbo].[cmsLanguageText] lt on lt.UniqueId = d.id")
Thanks again!
Ver
Hi Veronica
May I know if you have to do anything specific for the api portion to run?
When I install the plugin, add tinymce plugin and update tinymce.config, it shows in tinymce and when i click it opens the panel with two drop downs in it but page gives the following two red notifications below; (I assume the /umbraco/backoffice/rteDictionary/dictionary/GetLanguages api url gets registered by the line 19 where it reads [PluginController("rteDictionary")] ? Or is there something else that needs to be enabled for this API to be activated?
Request error: The URL returned a 404 (not found):
/umbraco/backoffice/rteDictionary/dictionary/GetLanguages
Request error: The URL returned a 404 (not found):
/umbraco/backoffice/rteDictionary/dictionary/GetDictionaryItems
Hi keilo,
I followed the exact structure that Oleg has in his git repository (see below).
The only change I made was the one I mentioned above in DictionaryController.cs. So long as you have the correct structure it should work.
Regards
Ver
Hi Veronica
Thanks for the reply. I have done exactly that, (and also incorporated your update on the SQL) copy DictionaryRTE under App_Plugins in its entirety. Using 7.1.6.
But for some reason when I click the button in RTE and sidepanel opens up with two dropdowns, i get the 2 red notifications that the URL for the webapi are 404.
I havent used this before so not sure if I need to enable something for the webApi to work?
If I try to open the URL on its own in a browser like
http://localhost/umbraco/backoffice/rteDictionary/dictionary/GetLanguages I get 404 - File or directory not found.
I believe Im missing something here.. something that needs to be enabled for webapi maybe? its a standard install of umbraco..
The only other thing I did was build my VS project as I have it set up as a web application not a web site.
I didn't make any other changes specifically for this plugin.
I have had those 404 errors in the past on my own plugin and found it was due to a javascript error.
BTW, how did you copy the files from github? Did you download the zip file or copy the files manually? If you copied them manually, you need to click on the Raw button for each file and then save that page. Right mouse-clicking the link and choosing 'save link as' will give you an HTML page. I did this once by mistake!
Hope this helps.
Ver
@Vasia Vasia, hi, I need to add a place holder text inside an RTE, the place holder text need to be configurated like dropdown values, so I want to place my drop down and inside the RTE and place the place holder text from the drop-down value.
I go throw the blow, You added the button inside RTE right, I tried to follow the same way, But I have few questions.
I checked your git repo Url: https://github.com/oleg-v/DictionaryRTEpluginumbraco.git
I need your help, kindly reply.
is working on a reply...