开发者

Adding buttons for HTML elements to the Sitecore rich text editor

开发者 https://www.devze.com 2023-02-18 05:04 出处:网络
I would like to add a button to the Sitecore rich text editor toolbar, specifically one that inserts the H2 element.

I would like to add a button to the Sitecore rich text editor toolbar, specifically one that inserts the H2 element.

I know the H2 element can be inserted using the paragraph styles pulldown menu, but all my editors are now using the bol开发者_开发技巧d button for their headings because they don't "see" the paragraph styles pulldown. So, I want to make the H2 easily available using a toolbar button. (And maybe even removing the bold buttons, since it's not semantic at all.)

But no matter how I go through the documentation, I cannot find a good explanation on how to do this.


In addition to the guide Yan posted, here's another guide.


I found a couple of walkthroughs for this...

Sitecore v6.3 and previous: link

Sitecore v6.4: link

Make sure that you select the core database (bottom right of Sitecore desktop) so that you can see the /sitecore/system/Settings/Html Editor Profiles area.


In my article here the first step of wiring up an event to a button is in javascript. From there you can insert text or tags. You can also get the selected text and wrap it in tags. You don't need to compile anything I was just showing how you would if you needed to, but you can entirely cut that piece out and just use the editor to send whatever text you want back to the wysiwyg editor.

0

精彩评论

暂无评论...
验证码 换一张
取 消