pnpframework icon indicating copy to clipboard operation
pnpframework copied to clipboard

Is there any switch provided where we can disable the parsing of Content Editor to be splitted into different webpart

Open webdevelperify opened this issue 3 years ago • 2 comments

Hi,

I want to map all classic content editor webpart to the React Modern JS Editor webpart irrespective of the content. Is there any feature available for this rather than modifying the code.

Thanks in advance for the help.

webdevelperify avatar Feb 19 '22 12:02 webdevelperify

@webdevelperify : you would need to modify the web part mapping file, think that can get you want you need. Copy this file and update the highlighted section (https://github.com/pnp/pnpframework/blob/dev/src/lib/PnP.Framework/Modernization/webpartmapping.xml#L205-L243) and then ensure custom mapping file is used when you run transformation

jansenbe avatar Mar 17 '22 08:03 jansenbe

Thank you Bert. I tried various way but it is not working in my case. There are many cases where I can explain this is happening as you are already aware of it:

  1. If in classic content editor, the HTML contains image and text then it splits in modern in Individual WebPart until Script tag is found. I think if CEWP do not have Script tag it never executed the Mapping.xml file of Content Editor.

  2. If the CEWP contain style tag which contains only text in HTML, then in modern the style tag is removed.

  3. Tried with addon model to override this method but was not successful. Was trying to inject dummy "script" tag always to the CEWP but it was not taken into consideration. Is AddOn is a pre step or post step in Transformation?

Also I do not see any change in the Mapping as it is same for me. Can you please explain what you have changed.

So was asking your help if switch can be provided just like how Community Editor one, to override this kind of default feature rather than changing the core engine.

Many thanks for looking into this topic :).

webdevelperify avatar Mar 17 '22 10:03 webdevelperify