StyleFormats stoppet showing after TinyMCE NuGet package updated to 4.1.0 from 3.3.3

ZZ
ZZ
Vote:
 

Hi,

We have updated EPiServer.CMS.TinyMce to 4.1.0 from 3.3.0 and this has cause the style formats to not showing up in TinyMCE.

using EPiServer.Cms.TinyMce.Core;
using EPiServer.ServiceLocation;
using Microsoft.Extensions.DependencyInjection;

namespace MitAkademikernes.Business.Initialization
{
    public static class CustomizedTinyMceInitializationExtension
    {
        public static IServiceCollection AddTinyMceCustomizations(this IServiceCollection services)
        {
            services.Configure<TinyMceConfiguration>(config =>
            {
                // Add the advanced list styles, table, and code plugins
                // and append buttons for inserting and editing tables
                // and showing source code to the toolbar
                config.Default()
                .AddEpiserverSupport()
                 .AddPlugin("media wordcount anchor code searchreplace")
                    .Toolbar("blocks fontsize | epi-personalized-content epi-link anchor numlist bullist indent outdent bold italic underline code",
                        "alignleft aligncenter alignright alignjustify |image epi-image-editor media | epi-dnd-processor | forecolor backcolor | removeformat | searchreplace fullscreen")
                    .StyleFormats(
                        new { title = "Accordion heading", block = "h2", classes = "accordion-header" }
                    )
                .AddSetting("image_class_list", new[] { xxx })
                ;
            });
            return services;
        }
    }
}

Accordion heading style format just add the class -> 

This is how it looked before upgrading to TinyMCE 4.1.0:

Now it looks like this without Formats button:

Any input would be appreciated
#305491
Edited, Jul 21, 2023 8:28
Vote:
 

Hi ZZ

I have "styles format" (plus a lot of ofter buttons) in one of my projects. Those results in two drop down lists.

#305493
Jul 21, 2023 16:04
Vote:
 

Hi ZZ

It seems the same bug has been reported Release note - CMS-25995 (optimizely.com)

You should update EPiServer.CMS.TinyMce to 4.3.0 or to the latest 4.4.1

#305612
Jul 24, 2023 2:05
ZZ
Vote:
 

After upgrading to TinyMCE ver. 4.4.1 I am still having the same issue

#305620
Jul 24, 2023 8:47
Vote:
 

If "styles" is present as a one of the toolbar items, then it could be an error in the StyleFormats data. In your case it could be that you need to turn "classes" into an array with a single string.

Or you could try wrapping your style object in an array, since you don't have any nested style items.

#305634
Edited, Jul 24, 2023 16:41
ZZ
Vote:
 

Thanks a lot. I was just missing  xx | styles format | xx in toolbar

#305681
Jul 25, 2023 11:34
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.