Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Multiple StyleFormats TinyMCE v2

Vote:
 

Is there a way to have different StyleFormats for different styleselects

In this example I would like the styleselect by the epi-link and anchor to only show button-style1 and the styleselect by the bullist an numlist to display the list-styles. Is it possible to differentiate the StyleFormats in that way?

config.Default()
                    .AddEpiserverSupport()
                    .AddPlugin("media wordcount anchor code lists")
                    .Toolbar(
                        "epi-link anchor styleselect | image epi-image-editor media | epi-dnd-processor", 
                        "bold italic underline | alignleft aligncenter alignright |  bullist numlist styleselect | formatselect removeformat code")
                    .StyleFormats(
                        new { title = "list-style1", selector = "ul", classes = "list-styled" },
                        new { title = "list-style2", selector = "ol", classes = "list-styled" },
                        new { title = "list-style3", selector = "ul", classes = "list-styled list-styled--checklist" },
                        new { title = "button-style1", selector="a", classes = "btn btn--primary" })
                    .ContentCss("/Static/styles/editor.css");
#202740
Edited, Mar 29, 2019 16:57
Vote:
 

Hi,

I don't think so, doesn't seem to be possible in TinyMCE either.

You should be able to group style formats, which is as simple as:

.StyleFormats
(
    new
    {
        title = "Red",
        items = new[] {
            new { title = "Red text", block = (string) null, inline = "span", styles = new { color = "#ff0000" } },
            new { title = "Red header", block = "h1", inline = (string) null, styles = new { color = "#ff0000" } },
        }
    },
    new
    {
        title = "Green",
        items = new[] {
            new { title = "Green text", inline = "span", styles = new { color = "#00ff00" } }
        }
    }
);
#202749
Mar 29, 2019 20:27
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.