Skip to content

How to configure the menu items in Blazor? #81

@Webreaper

Description

@Webreaper

I'm trying to customise the menu items in Blazor and have this:

<Editor ApiKey="@myKey" @bind-Value="@content" Conf="tinyConf"/>

@code { 
  protected override void OnInitialized()
  {
    var menu = new 
    {
      edit = new { title = "Edit", items = "undo redo | cut copy paste | selectall | searchreplace"},
      insert = new { title = "Insert", items = "image link media template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},
      format = new { title = "Format", items = "bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | removeformat"},
      view = new { title = "View", items = "code | visualaid visualchars visualblocks | spellchecker | preview fullscreen"},
      table = new { title = "Table", items = "inserttable | cell row column | tableprops deletetable" },
      tools = new { title = "Tools", items = "spellchecker spellcheckerlanguage | code wordcount"}
    };    

    tinyConf = new Dictionary<string, object>
    {
      { "width", "90%" },
      { "branding", false},
      { "statusbar", true },
      { "height", "400px"},
      { "max_height", 400},
      { "menu", menu }
    };

    base.OnInitialized();
  }

However, the custom menu isn't being initialised, and TinyMCE is just using the basic/standard menu. I get no errors. Any clue what I'm doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions