-
Verify the installation by checking the
ItemGroupreferences in the project file. For example, if the project is named BlazorApp, the relevant file would beBlazorApp.csprojwith the dependency referenced as follows:<ItemGroup> <PackageReference Include="TinyMCE.Blazor" Version="X.Y.Z" /> </ItemGroup>
-
Add the
tinymce-blazor.jsscript to the main page. If using the Blazor Web App, add the script inComponents/App.razor, for example:<script src="_framework/blazor.web.js"></script> <script src="_content/TinyMCE.Blazor/tinymce-blazor.js"></script>
NoteThe location of the script depends on the type of Blazor app, including Blazor Server and Blazor WebAssembly (WASM) which are not covered in this guide.
-
If using Blazor Server, add the script in
Pages/_Host.cshtml, for example:<script src="_framework/blazor.server.js"></script> <script src="_content/TinyMCE.Blazor/tinymce-blazor.js"></script>
-
If using WASM, add the script in
wwwroot/index.html, for example:<script src="_content/TinyMCE.Blazor/tinymce-blazor.js"></script> <script src="_framework/blazor.webassembly.js"></script>
-
-
Add the
Editorcomponent to a page by either:-
Using the
usingdirective:@using TinyMCE.Blazor <Editor />
For example:
File:
Pages/Index.razor@page "/" @rendermode InteractiveServer @using TinyMCE.Blazor <h1>Hello, world!</h1> Welcome to your new app. <Editor />
-
Using the component with its namespace:
<TinyMCE.Blazor.Editor />
For example:
File:
Pages/Index.razor@page "/" @rendermode InteractiveServer @using TinyMCE.Blazor <h1>Hello, world!</h1> Welcome to your new app. <Editor />
ImportantIn a Blazor Web App, different render modes determine how components are rendered and how interactivity is handled. To enable JavaScript interactivity, ensure that @rendermode InteractiveServeris specified in a page component.
-
-
Update the
LicenseKeyoption in the editor element and include your License Key.<Editor LicenseKey="your-license-key" />
-
To load {productname} from the self-hosted package instead of the {cloudname}, configure the
ScriptSrcproperty:<Editor ScriptSrc="/path/to/tinymce.min.js" />