Try our conversational search powered by Generative AI!

Adding CSS and HTML via editor site

ZZ
ZZ
Vote:
 

HI, 

We have a issue that some editors want to add CSS & HTML to different blocks & pages. Right now we generate a single css file from different sccs files and stying is then applied to whole website vis css classes. 

Would it be possible to give editors possibility of writing css or HTML direct in block or page.

Could it create som peroformance issues ?

#260452
Aug 11, 2021 13:32
Vote:
 

Hi,

You can allow them to write the HTML code inside rich text editor fields (TinyMCE) by adding the "code" plugin.

Have a look at Arild's blog post for more details on how to configure TinyMCE: https://www.epinova.no/folg-med/blogg/2018/configuring-default-toolbar-buttons-in-tinymce-4-for-episerver/

#260453
Aug 11, 2021 14:30
Vote:
 

As well as Dejan's suggestion there's also https://www.david-tec.com/2018/07/virtual-template-system-for-episerver-relaunched/ which allows you to modify templates directly in the editor. Allow blocks/pages to be customized with HTML/CSS where needed. But with this approach you're taking the quality control out of the deveopments teams hands so it's possible to break sites when editing if you're not careful.

Also there would be no performance implications to either of these 2 approaches.

#260454
Edited, Aug 11, 2021 14:39
Vote:
 

Consider customizing the TinyMCE toolbar to provide for the content authors a list of available CSS style classes to choose from, in this way the developer still controls the style classes available to editors and they need not type the html syntax to apply the class to an html element. A "win-win", because authors will occasionally need to override the default style applied via the element, yet they should not be required to learn HTML to accoplish this simple task.
Customizing the TinyMCE toolbar is discussed in detail within the available Developer Premium training subscriptions, including the ability to limit which groups of authors have access to specific functionality and the ability to assign different toolbars to xhtml properties within specific content types.  

#260875
Aug 20, 2021 2:13
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.