Try our conversational search powered by Generative AI!

Can't see embed code in editor

Vote:
 

Hi!

After upgrade to update 304 we cant see the source code for embed and iframes that we published in the editor before the upgrade. The page can still show the iframe and embed content but its invisible in the editmode, when we hit the view source button in the editor the popup is blank. If we put new embed or iframe code in the editor it works, Then we can view the source in the editor and the embed code shows in the popup. 

Any clues on what's going on?

We are running: 

  • EPiServer.Forms.UI 4.27.0.0
  • EPiServer.UI 11.23.6.0
  • EPiServer 11.14.1.0
  • EPiServer.Cms.AspNet 11.14.1.0
  • EPiServer.XForms 1.0.3.0
  • EPiServer.LinkAnalyzer 11.14.1.0
  • EPiServer.Cms.Shell.UI 11.23.6.0
  • EPiServer.Search.Cms 9.0.3.0

Best regards

Kristian

#222446
May 06, 2020 6:20
Vote:
 

Hi,

I think you are talking about the TinyMCE code button then you can add it back using the initialization module-

using EPiServer.Cms.TinyMce.Core;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.ServiceLocation;

namespace MyEpiserverSite.Business.Initialization
{
    [ModuleDependency(typeof(TinyMceInitialization))]
    public class ExtendedTinyMceInitialization : IConfigurableModule
    {
        public void Initialize(InitializationEngine context)
        {
        }

        public void Uninitialize(InitializationEngine context)
        {
        }

        public void ConfigureContainer(ServiceConfigurationContext context)
        {
            context.Services.Configure<TinyMceConfiguration>(config =>
            {
                config.Default()
                    .AddPlugin("media wordcount anchor code")
                    .Toolbar("formatselect | epi-personalized-content epi-link anchor numlist bullist indent outdent bold italic underline alignleft aligncenter alignright | image epi-image-editor media code | epi-dnd-processor | removeformat | fullscreen")
                    .AddSetting("image_caption", true)
                    .AddSetting("image_advtab", true);
            });
        }
    }
}
#222448
Edited, May 06, 2020 6:40
Vote:
 

Hi!

Unfortunately that didn't help. We already have an ExtendedTinyMceInitialization with everything we need. 

Our problem is that we can't see the source code for iframes created before the upgrade when we click the "source code" button in TinyMCE, but we can see the source code for iframes created after the upgrade.

Best regards 

Kristian

#222452
Edited, May 06, 2020 6:58
Vote:
 

Try adding

AddSetting("extended_valid_elements", "iframe[src|frameborder=0|alt|title|width|height|align|name]");
#222454
Edited, May 06, 2020 7:02
Vote:
 

Thank's for your time, but that didn't help either. We still can't view the source code for iframes created before the upgrade when we click the "source code" button in TinyMCE, but we can see the source code for iframes created after the upgrade.

#222463
May 06, 2020 8:25
Ravindra S. Rathore - May 06, 2020 9:01
Have you tried adding a new iframe after the "Addsetting" method?
Kristian Ledung - May 06, 2020 9:13
Yes I have, and that works as good as adding iFrames after the upgrade. Adding iFrames has always worked and old iFrames is visible for the end user but we can't see the code in edit-mode when we select "source code" in TinyMce.
Vote:
 

I managed to figure out the problem. The iframe we couldn't see in the editors source code mode was inserted via a JavaScript and the problem was that we don't allow JavaScript in the editor anymore.

If we wan't to allow JavaScript in TinyMCE we could add this to ExtendedTinyMceInitialization.cs:

.AddSetting("extended_valid_elements", "script[src|async|defer|type|charset]")

#222703
May 11, 2020 11:23
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.