Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Vasia Vasia 49 posts 241 karma points
    Apr 09, 2014 @ 14:16
    Vasia Vasia
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 09, 2014 @ 14:25
    Jan Skovgaard
    0

    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

  • Vasia Vasia 49 posts 241 karma points
    Apr 10, 2014 @ 13:33
    Vasia Vasia
    100

    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

     

     

     

     

     

  • Chris Vickers 4 posts 80 karma points
    Sep 11, 2014 @ 20:52
    Chris Vickers
    0

    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

  • Vasia Vasia 49 posts 241 karma points
    Sep 12, 2014 @ 16:04
    Vasia Vasia
    0

    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:

    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");
     
                dialogService.open({
                    template: '/App_Plugins/RTEDictionary/dictionarykeylist.html',
                    callback: function (data) {
                        editor.insertContent(data);
                    }
                });
            }
        });
    });

    Then you need to create custom plugin where from DB you can get everything you needed.

    Let me know if any questions.

    Thanks, Oleg

  • Chris Vickers 4 posts 80 karma points
    Sep 15, 2014 @ 10:19
    Chris Vickers
    0

    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

  • keilo 568 posts 1023 karma points
    Sep 17, 2014 @ 18:09
    keilo
    0

    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!

  • Vasia Vasia 49 posts 241 karma points
    Sep 22, 2014 @ 07:33
    Vasia Vasia
    0

    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

  • Veronica Burd 76 posts 201 karma points
    Sep 22, 2014 @ 09:56
    Veronica Burd
    0

    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 

    "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")

    Thanks again!

    Ver

  • keilo 568 posts 1023 karma points
    Sep 22, 2014 @ 11:12
    keilo
    0

    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

  • Veronica Burd 76 posts 201 karma points
    Sep 22, 2014 @ 11:25
    Veronica Burd
    0

    Hi keilo,

    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. 

    Regards

    Ver

  • keilo 568 posts 1023 karma points
    Sep 22, 2014 @ 11:46
    keilo
    0

    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..

  • Veronica Burd 76 posts 201 karma points
    Sep 22, 2014 @ 12:16
    Veronica Burd
    0

    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

  • Vetrivel 21 posts 130 karma points
    Jun 16, 2020 @ 07:39
    Vetrivel
    1

    @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.

    1. I checked your git repo Url: https://github.com/oleg-v/DictionaryRTEpluginumbraco.git

      • It's not working now, I need the sample, which can help me a lot.

      I need your help, kindly reply.

Please Sign in or register to post replies

Write your reply to:

Draft