How to do full justify in RTE | Community
Skip to main content
CT1012
Level 4
August 6, 2018
Solved

How to do full justify in RTE

  • August 6, 2018
  • 4 replies
  • 3547 views

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.
Best answer by arunpatidar

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

4 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
August 7, 2018

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
Level 2
September 2, 2021

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.

CT1012
CT1012Author
Level 4
August 8, 2018

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

arunpatidar
Community Advisor
Community Advisor
August 8, 2018

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

Arun Patidar
Hafizur-Rahman
Level 2
April 22, 2021

Just use :

justify#justifyjustify

It worked for me well.