Copied to clipboard

Flag this post as spam?

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


  • Fabian 23 posts 103 karma points
    May 15, 2015 @ 11:57
    Fabian
    0

    RichTextEditor in Custom grid control

    Hello,
    is there a way to use a RTE inside a custom grid control? Maybe with the tinyMceService?!
    I tried to use the code from Option 3 from this site: http://www.enkelmedia.se/blogg/2013/12/4/umbraco-7-use-the-rich-text-editor-tinymce-in-a-custom-section.aspx ;
    But seems only to work in custom section and NOT in a custom grid controls.
    Any ideas?

    Thanks, fabian

     

  • Mehul Gajjar 48 posts 172 karma points
    May 15, 2015 @ 14:18
  • Fabian 23 posts 103 karma points
    May 15, 2015 @ 14:58
    Fabian
    0

    Thanks for your reply but on these pages is no example to how use a RTE in a custom grid control ;)
    I already built some custom grid controls but I'm not able to get the rte running.

    Thanks, fabian 

  • Mehul Gajjar 48 posts 172 karma points
    May 18, 2015 @ 13:59
    Mehul Gajjar
    0

    Hi Fabian,

    kindly check below link

    https://our.umbraco.org/Documentation/Using-Umbraco/Backoffice-Overview/Property-Editors/Built-in-Property-Editors-v7/Grid-Layout/grid-editors

    it shows the example of Rich text editor in Grid.

    Regards,

    Mehul Gajjar.

  • Fabian 23 posts 103 karma points
    May 18, 2015 @ 14:23
    Fabian
    0

    Hi Mehul Gajjar,

    sorry, think you didn't get me. How to use RTE in Grid is fine for me.
    Maybe my wording was wrong. We want to built a Custom grid editors also called custom grid control which should include a RTE, a H2 and other html tags . 
    Topic is already discussed here https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/59563-Tutorial-on-creating-custom-grid-editors

    But no information about the RTE inside a custom control.
    Hope you could understand what I'm looking for ;)

    Best regards, fabian 

  • yogesh pathak 136 posts 221 karma points
    Jun 05, 2015 @ 08:45
    yogesh pathak
    0

    Hey Fabian,

    Any luck on using Rich text editor inside a custom grid control?

    if yes can you please share it here ?

    thanks

    Yogesh

  • Fabian 23 posts 103 karma points
    Jun 05, 2015 @ 09:23
    Fabian
    0

    Hi Yogesh,

    had no luck. I'm using a normal textbox till now and allow html tags.
    Next week im on the CodeGarden conference, maybe there somebody can help  ;) 

    fabian 

  • yogesh pathak 136 posts 221 karma points
    Jun 05, 2015 @ 10:43
    yogesh pathak
    0

    Lucky you , attending code garden :)

    please share the sollution if you get from there

    Thanks

    Yogesh

     

  • Calle Bjernekull 28 posts 103 karma points
    Oct 21, 2015 @ 13:57
    Calle Bjernekull
    2

    In case you haven't found a solution on this yet. First add this in a custom grid-controller:

    angular.module("umbraco").controller("My.Custom.Control.With.RTE", function ($scope) {
    $scope.rteconfig =
        {
            "toolbar": ["code", "removeformat", "styleselect", "bold", "alignleft", "aligncenter", "alignright", "bullist", "numlist", "outdent", "indent", "link", "unlink", "umbmediapicker"],
            "stylesheets": ["mycustomstylesheet"],
            "dimensions":
                {
                    "height": 500
                },
            "maxImageSize": 1170
        }});
    

    And in my editor-view

    <div ng-controller="My.Custom.Control.With.RTE">
    
    <div unique-id="control.$uniqueId"
            value="control.value.content"
            grid-rte configuration="rteconfig">
    </div>    </div>
    
  • yogesh pathak 136 posts 221 karma points
    Oct 21, 2015 @ 15:05
    yogesh pathak
    0

    Thanks a ton, i will try that :)

    Yogesh

  • Jonathan 6 posts 39 karma points
    Nov 05, 2015 @ 21:13
    Jonathan
    1

    @Calle:

    That worked for me. I've been struggling with this for some time, so I appreciate finding your post. Most searching comes up with the same how-to articles listed above, but those don't specifically deal with RTE inside a Grid.

    The only thing missing from your instruction (for future readers) is to add a reference to the controller.js in the package.manifest:

    {
        "gridEditors": [
            {
                "name": "My RTE",
                "alias": "CustomRTE",
                "view": "~/App_Plugins/Grid/custom.rte.editor.html",
                "icon": "icon-layout"
            }
        ],
    
        "javascript": [
            "~/App_Plugins/Grid/custom.rte.controller.js"
        ]
    }
    

    And of course make sure to use the same "alias" name in all 3 files (manifest, controller, editor).

    The final piece I'm still banging on is to render html tags when a user selects a style. For example: If the user selects a style "Heading 1", I need the RTE to wrap H1 around the text, rather than apply a class.

    EDIT: found it: http://shermandigital.com/blog/add-formats-to-umbraco-richtext-editor/

    Thanks again for posting your solution, it seems like a very common problem and needs to be added to the default property editor documentation.

  • Calle Bjernekull 28 posts 103 karma points
    Nov 06, 2015 @ 10:16
    Calle Bjernekull
    0

    You are right Jonatan. I should have attached the manifest-file too. I just assumed the manifest-file was already in place at this point.

  • Rishabh 24 posts 94 karma points
    Aug 04, 2016 @ 09:32
    Rishabh
    0

    Hi guys,

    I need to customize the grid layout like these things please help to me

    1) row an incons menu is displayed. Only the "delete" icon must be diplayed, not a configuration icon.

    2) When i select a content after "Add content", the content is inserted and it allows to add mor content into that grid item. The system must allow only one content for each grid item.

  • Tom 713 posts 954 karma points
    May 03, 2017 @ 02:27
    Tom
    0

    Hi guys we've done something like this as well but I can't get the embed type working.. If I take a look at umbraco.controllers.js they do some work to hook up a dialog for when the embed button is pressed.

    Does anyone have any experience/advice getting this working in a custom format?

    angular.module("umbraco").controller("Grid.RichTextEditorContent", function ($scope, dialogService, tinyMceService) {
        $scope.control.value = $scope.control.value || { rte: null, heading: '' };
    
        if (!$scope.control.value.rte) {
            $scope.control.value.rte = {
                name: 'Rich text editor',
                alias: 'rte',
                view: 'rte'
            }
        }
        $scope.model = $scope.model || {};
        $scope.model.config = $scope.model.config || {};
        $scope.model.config.editor = {
            toolbar: ["code", "styleselect", "link", "unlink", "umbembeddialog"],
            stylesheets: ['rte-content'],
            dimensions: { height: 200 }
        };
    });
    

    Note the umbembeddialog property in the toolbar. The embed icon shows up but the click event does nothing and raises no errors in console. Thanks!

  • Leonard Sorgdrager 7 posts 87 karma points
    May 31, 2017 @ 16:24
    Leonard Sorgdrager
    0

    Tom,

    Have you been able to get an answer on this question? We are also seeing that, beginning with 7.5.14, the Embed and Link dialogs are not working when used in an RTE in a custom editor. This used to work in 7.5.13.

    Thanks.

  • Tom 713 posts 954 karma points
    May 31, 2017 @ 23:12
    Tom
    0

    Hi Leonard, Unfortunately not.

Please Sign in or register to post replies

Write your reply to:

Draft