• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Preventing users from changing fonts/font size/colour?

GregF

Active member
#1
Is there any way of adjusting settings to prevent members from changing fonts, font sizes & colours? As they can sometimes be a little too creative, which can make things a bit distracting sometimes...

Thanks,
Greg
 

Brogan

XenForo moderator
Staff member
#2
There are no settings available which will prevent that.
I just tried forcing font settings in the Style Properties -> Message Elements -> Message Text but it doesn't work as the styling is applied inline.

You could likely do it with code modifications to the server files.
 

Forsaken

Well-known member
#3
Code:
.messageList .messageText
{
font-family:@messageText.font-family !important;
font-size:@messageText.size !important;
color:@body.color !important;
}

Would force it to be the defaults all the time.
 

Brogan

XenForo moderator
Staff member
#4
I tried that and it didn't work.

Although I only tried it in Style Properties and EXTRA.css, not by editing the css template directly.
 

Digital Doctor

Well-known member
#5
Is there any way of adjusting settings to prevent members from changing fonts, font sizes & colours? As they can sometimes be a little too creative, which can make things a bit distracting sometimes...

Thanks,
Greg
I wonder if this would require modifications to the TinyMCE editor itself ?
 

Forsaken

Well-known member
#6
Code:
.messageList .messageText span
{
font-family:@messageText.font-family !important;
font-size:@messageText.font-size !important;
color:@body.color !important;
}
If you remove any of the declarations, you can allow them to change whichever they want. It basically just replaces the <span> inline style that BBCode produces.
 

Digital Doctor

Well-known member
#10
Wordpress uses TinyMCE.
Here is an article about customizing the TinyMCE Text editor in Wordpress.
I don't know if that provides any further clues ?
:)
I guess Xenforo would be considered a Third Party Plugin of TinyMCE ? non ?
There is a forum for that:
Third party plugins
http://tinymce.moxiecode.com/forum/viewforum.php?id=3
Tips, Tricks & HowTo's
http://tinymce.moxiecode.com/forum/viewforum.php?id=1
I see some TinyMCE API documentation.
http://tinymce.moxiecode.com/wiki.php/API3:class.tinymce

I think many people would like to know more about tweaking TinyMCE in Xenforo.
 

dieketzer

Well-known member
#11
ive had an edit posted for ages to remove colour functionality from tinymce.
one could use that as a guide for disabling font size/face as well. the edits would be similar and would be located in the same files.
 

Rudy

Well-known member
#13
Code:
.messageList .messageText span
{
font-family:@messageText.font-family !important;
font-size:@messageText.font-size !important;
color:@body.color !important;
}
If you remove any of the declarations, you can allow them to change whichever they want. It basically just replaces the <span> inline style that BBCode produces.
Apologies for bumping this up, but I can vouch for this--it works on font color (which I needed) and the others. The key was adding "span" to the CSS above.

And since we're in Redactor now, this CSS will handily remove the buttons; comment out or delete what you want to keep:

HTML:
/* Remove editor buttons */
.redactor_btn_container_fontfamily {display: none;}
.redactor_btn_container_fontsize {display: none;}
.redactor_btn_container_fontcolor {display: none;}
Colored text has been a major annoyance of mine. Good riddance. ;)
 

Rudy

Well-known member
#15
You can also use this add-on to remove any pasted BB Code you wish to have removed once the post is saved.

https://xenforo.com/community/resources/bb-code-parser.2796/
Ooooh, that's interesting--thanks! Indeed, I will take a look at that. That would also help avoid member confusion since in the editor, the colored text still remains when editing, but disappears upon display.

Many years ago, I added CSS to get rid of "weirdness" in member signatures by forcing some parameters in CSS (disallowing IMG, or "blocks" like quotes or code), along with making it 80% opaque and restricting the font size. That was before XF added a few settings and permissions for signatures.
 

Rudy

Well-known member
#17
Members want signatures in the posts (including links), but I wanted to control how they appeared. I keep signatures disabled on most forums I visit (including here) since I find them highly distracting (and don't get me started on images in signatures!). I figured for forums that I run (and need to monitor signatures in, as being part of the staff), I would limit the font size so they would not ever appear larger than the post text, and made them slightly opaque (80%) so that regardless of the theme's font color, the signature would adapt and appear slightly more faint. On all forums, too, I have installed the add-on which displays the signature only once per page (in that person's first post on the page).

A key point is that I did these changes really early, right after we converted, so members would not get hung up on something that had changed.