HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Disallow font and size selection in WYSIWYG editor

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#51613 (In Topic #11270)
Avatar

Fan in action

Trying to enforce some stylistic cohesion while leaving options open

Hi everybody,

Is there a way of disabling the Font and Size selectors for the WYSIWYG editor but leaving the rest of the options open. I'm going to have a lot of user generated content and want to give them display options while keeping a little bit of consistency sitewide. Will have a bash at hacking around myself on this later and post results but on the off chance anybody has already done this on their site then maybe they could let me know what their experience was.

so…any tips?

a
Back to the top
 
Posted
Rating:
#53212
Avatar

Well-settled

Did you have any luck with this - I'd be very interested in doing the same.
Back to the top
 
Posted
Rating:
#53214
Avatar

Fan in action

sadly no…it's on my list of stuff to look at properly next week though so if i work anything out i'll post here

a
Back to the top
 
Posted
Rating:
#53242
Avatar

Honoured member

You have to edit the htmlarea.js file in  /data/areaedit/

the lines you want to change are:

this.fontsize={"— size —":"","1 (8 pt)":"1","2 (10 pt)":"2","3 (12 pt)":"3","4 (14 pt)":"4","5 (18 pt)":"5","6 (24 pt)":"6","7 (36 pt)":"7"}

to

this.fontsize={"— size —":""}

and this

this.fontname={"— font —":'',"Arial":'arial,helvetica,sans-serif',"Courier New":'courier new,courier,monospace',"Georgia":'georgia,times new roman,times,serif',"Tahoma":'tahoma,arial,helvetica,sans-ser
if',"Times New Roman":'times new roman,times,serif',"Verdana":'verdana,arial,helvetica,sans-s
erif',"impact":'impact',"WingDings":'wingdings'}

to

this.fontname={"— font —":''}


That will do it, the options will still show but they have nothing to select.  I know it's hack at best, but I couldn't figure out how to completely remove the drop down, it kept giving me errors.

Maybe someone else will have better luck at hacking up that file.

In any case, it gets you closer to where you wanna be.

Good luck :-)  sorry I couldn't take you all the way to full solution.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: