Copied to clipboard

Flag this post as spam?

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


  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Jul 24, 2015 @ 19:21
    David Brendel
    0

    Use RTE prevalues in custom section

    Hi community,

    I'm currently trying to use the prevalues of the umbraco rte in my custom section. I got the rte working by hardcoding the toolbar that the editor should use.

    Now I want to use the prevalue settings that are configured for the rte. Can I somehow load the configured values.

    I tryed to load the configuration with the tinyMCEService.configuration() but its always the default one.

    Anyone got some tips?

    Regards David

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Jul 26, 2015 @ 20:19
    David Brendel
    0

    I found a hacky way myself.

    For this you have to query the database for the prevalues.

    var query = new Sql().Select("value").From("cmsDataTypePreValues").Where("datatypeNodeId = -87");
            var tmp = ApplicationContext.Current.DatabaseContext.Database.FirstOrDefault<string>(query);
            if(!tmp.StartsWith("{")){
                return tmp;
            }
            return JsonConvert.DeserializeObject(tmp);
    

    This works but isn't really the best way I think cause the id can change. Until I find a better solution I will use this.

    Regards David

Please Sign in or register to post replies

Write your reply to:

Draft