How to add rtl button to editor
3 posters
How to add rtl button to editor
Hi
I want to add these two buttons to the editor (post a message) :
Right-to-Left (rtl)(/rtl)
Left-to-Right (ltr)(/ltr)

Here is My forum which is phpBB2
Here is a demo for SEEditor which has these buttons
How can I do it?
Thanks in advance
I want to add these two buttons to the editor (post a message) :
Right-to-Left (rtl)(/rtl)
Left-to-Right (ltr)(/ltr)

Here is My forum which is phpBB2
Here is a demo for SEEditor which has these buttons
How can I do it?
Thanks in advance
5arid- New Member
- Posts : 13
Reputation : 2
Language : Farsi
Re: How to add rtl button to editor
Sorry, but those BBCodes will not work on Forumotion forums. Not all BBCodes can work on forums hosted by different companies.


Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray- Administrator
-
Posts : 50257
Reputation : 3466
Language : English
Location : United States
Re: How to add rtl button to editor
How about setting the SCEditor to rtl as default?
5arid- New Member
- Posts : 13
Reputation : 2
Language : Farsi
Re: How to add rtl button to editor
I could set the SCEditor to RTL as default :
Administration Panel > Modules > HTML & JAVASCRIPT > Javascript codes managment > Create a new javascript :
Title : RTL Dir
Placement : In all the pages
Javascript Code :
Enable Javascript code management : Yes
***************************************************
The above code works fine for RTL function.
So this code should work for LTR function :
Now how can I make those new buttons using these codes?
Administration Panel > Modules > HTML & JAVASCRIPT > Javascript codes managment > Create a new javascript :
Title : RTL Dir
Placement : In all the pages
Javascript Code :
- Code:
$(function(){$(function(){$('.sceditor-container iframe').contents().find('p').attr('dir','rtl')})});
Enable Javascript code management : Yes
***************************************************
The above code works fine for RTL function.
So this code should work for LTR function :
- Code:
$(function(){$(function(){$('.sceditor-container iframe').contents().find('p').attr('dir','ltr')})});
Now how can I make those new buttons using these codes?
5arid- New Member
- Posts : 13
Reputation : 2
Language : Farsi
Re: How to add rtl button to editor
Those tags exist for typing in the Sceditor already.
ltr :
rtl :
The text alignment buttons :

ltr :
- Code:
[left][/left]
rtl :
- Code:
[right][/right]
The text alignment buttons :

Ange Tuteur- Forumaster
-
Posts : 13244
Reputation : 2990
Language : English & 日本語
Location : Pennsylvania
Re: How to add rtl button to editor
@ Ange Tuteur
No that is different!
Read this to find out their difference :
align Attribute (left|right|center|justify)
dir Attribute (ltr|rtl|auto)
Also you can see the difference practically with this : Here is a demo for SEEditor which has these buttons
No that is different!
Read this to find out their difference :
align Attribute (left|right|center|justify)
dir Attribute (ltr|rtl|auto)
Also you can see the difference practically with this : Here is a demo for SEEditor which has these buttons
5arid- New Member
- Posts : 13
Reputation : 2
Language : Farsi
Re: How to add rtl button to editor
I see what you mean now. Unfortunately the rtl and ltr tags are not in the bbcodes for Forumotion's Sceditor.
You can always suggest to add these tags though :
https://help.forumotion.com/f30-suggestions-for-your-forums
You can always suggest to add these tags though :
https://help.forumotion.com/f30-suggestions-for-your-forums
Ange Tuteur- Forumaster
-
Posts : 13244
Reputation : 2990
Language : English & 日本語
Location : Pennsylvania
Re: How to add rtl button to editor
Well, for now I am pleased with my sceditor to some extent because by using the above code it is RTL and typing Farsi works fine.
For typing English I need LTR button for sure but fortunately it is not really necessary, so I can live without that!
By the way here is a nice tutorial : Tutorial: How to add buttons in your SCEditor (Quick reply and New Topic form)
By using it I could add LTR button, but it seems it is useless as you mentioned it :
Or maybe I messed up something?!
For typing English I need LTR button for sure but fortunately it is not really necessary, so I can live without that!
By the way here is a nice tutorial : Tutorial: How to add buttons in your SCEditor (Quick reply and New Topic form)
By using it I could add LTR button, but it seems it is useless as you mentioned it :
Ange Tuteur wrote:Unfortunately the rtl and ltr tags are not in the bbcodes for Forumotion's Sceditor
Or maybe I messed up something?!

5arid- New Member
- Posts : 13
Reputation : 2
Language : Farsi
Re: How to add rtl button to editor
Correct, rtl and ltr are not in Forumotion's bbcodes, so :
writing
[rtl]text[/rtl]
and
[ltr]text[/ltr]
would do nothing.
That topic only uses the insertText method which does no parsing of tags you make up.
writing
[rtl]text[/rtl]
and
[ltr]text[/ltr]
would do nothing.
That topic only uses the insertText method which does no parsing of tags you make up.
Ange Tuteur- Forumaster
-
Posts : 13244
Reputation : 2990
Language : English & 日本語
Location : Pennsylvania

» Add button on SC Editor
» How to add button to editor
» BBcode button in editor
» Add emojis button to the editor
» Editor Button for just one forum
» How to add button to editor
» BBcode button in editor
» Add emojis button to the editor
» Editor Button for just one forum
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum