1. 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?

Discussion in 'XenForo Questions and Support' started by GregF, Jun 21, 2011.

  1. GregF

    GregF Active Member

    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...

  2. Brogan

    Brogan XenForo Moderator Staff Member

    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.
  3. Forsaken

    Forsaken Well-Known Member

    .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.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    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.
  5. Digital Doctor

    Digital Doctor Well-Known Member

    I wonder if this would require modifications to the TinyMCE editor itself ?
  6. Forsaken

    Forsaken Well-Known Member

    .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.
  7. DroidHost

    DroidHost Well-Known Member

    I think you can do something here

    I dont know

  8. Phillip

    Phillip Active Member

    If anyone finds a workaround for this please let us know. Easy to follow instructions would be very helpful.
  9. GregF

    GregF Active Member

  10. Digital Doctor

    Digital Doctor Well-Known Member

    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
    Tips, Tricks & HowTo's
    I see some TinyMCE API documentation.

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

    dieketzer Well-Known Member

    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.
    Digital Doctor likes this.
  12. Digital Doctor

    Digital Doctor Well-Known Member

  13. Rudy

    Rudy Well-Known Member

    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:

    /* 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. ;)
  14. AndyB

    AndyB Well-Known Member

    Rudy likes this.
  15. Rudy

    Rudy Well-Known Member

    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.
  16. AndyB

    AndyB Well-Known Member

  17. Rudy

    Rudy Well-Known Member

    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.

Share This Page