Added buttons to AlloyEditor toolbar don't work in Blogs
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- I added buttons such as strike-through, superscript, and subscript to the AlloyEditor toolbar, but these buttons don't work when attempting to edit content in the Blogs module.
Resolution
- The strike-through, superscript, subscript, and page break buttons do not work for the Blogs portlet as the Blogs portlet itself specifies a whitelist of allowed tags as part of the AlloyEditor configuration. However, the tags utilized by these buttons are not whitelisted. This cannot be configurable, and Liferay will need to be customized to allow these buttons.
The following information is regarding customization and should be implemented at your team's discretion. Liferay Support is limited in assisting customization.
As a starting point, you can blacklist the com.liferay.blogs.editor.configuration.internal.BlogsContentEditorConfigContributor component. With just this change, the strike-through, superscript, and subscript buttons work again, but since this component is also responsible for generating a file browser URL for uploading files, you will need to add your own custom contributor for blogs to re-add the appropriate URL.
The blockquote tag is also not whitelisted, but it will appear not to work even after the component is blacklisted due to styling (the margin-left is set to 0 in clay).
Did this article resolve your issue ?