How to do full justify in RTE | Community
Skip to main content
CT1012
Level 4
Aug 6, 2018 8:24 PM UTC
Solved

How to do full justify in RTE

How to do full justify(justify on both left and right) in RTE apart from

justify#justifyleft

justify#justifycenter

justify#justifyright

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Aug 7, 2018 8:33 AM UTC

Hi,

OOTB you can do justify left, right and centre. which basically add inline style text-align:<value>. e.g. text-align:left

You can modify existing plugin and add one more option/type alignment which is text-align:justify

Thanks

Arun

Arun Patidar

5 replies

Hafizur-Rahman
Level 2
Apr 22, 2021 1:27 PM UTC

Just use :

justify#justifyjustify

It worked for me well.

Translate
arunpatidar
New Participant
Aug 8, 2018 4:10 PM UTC

HI,

You should be using granite UI rather than coarl2.

/libs/clientlibs/granite/richtext/core/js/plugins/JustifyPlugin.js is the plugin file but you need to add extra plugin option in dialog jsp file as well.

/libs/dam/cfm/admin/components/authoring/contenteditor/toolbar/toolbar.jsp

Thansk

Arun

Translate
Arun Patidar
CT1012
CT1012Author
Level 4
Aug 8, 2018 3:54 PM UTC

Thanks for the response

Which one should i be using for existing plugin js, both carry the same code( i tried coralui2 path)

/libs/clientlibs/granite/richtext/core/js/plugins/JustifyPlugin.js

/libs/cq/ui/coralui2/rte/core/plugins/JustifyPlugin.js

Within the JS is this the correct way to add justify full

'justify': {

              'title': CUI.rte.Utils.i18n('plugins.justify.fullTitle'),

              'text': CUI.rte.Utils.i18n('plugins.justify.fullText')

            }

Please suggest

TIA

Translate
arunpatidar
arunpatidarAccepted solution
New Participant
Aug 7, 2018 8:33 AM UTC

Hi,

OOTB you can do justify left, right and centre. which basically add inline style text-align:<value>. e.g. text-align:left

You can modify existing plugin and add one more option/type alignment which is text-align:justify

Thanks

Arun

Translate
Arun Patidar
Level 2
Sep 2, 2021 8:29 AM UTC

Hi @1464355 

 

Is it possible to extend the functionality of this plugin to vertical-align: top/middle/bottom ?

If yes, then where can I add the on click events of those icons.

 

Thanks.

Translate