Joss Posted December 4, 2012 Share Posted December 4, 2012 HI I posted this on the end of another thread, but it is a bit far down on the list. I need to enable font colour and font size on a field. I have added to the tool bar, and that bit works. I have added this to the valid elements -font[face|size|color] I have added @[id|class|style] However, when I use the buttons it changes the size,but it is not saving the change. And if you open the html on TinyMCE, it hasn't been added as a style to the element. I have tried with and without the - in front of font, I have tried sticking "style" everywhere I can think of, I have tried changing the order - where I put the font group. But nothing is working. Any thoughts? Joss Solution This has been solved by Ryan on another thread. Rather than use font[face|size|color], please use span[face|size|color] J Link to comment Share on other sites More sharing options...
ryan Posted December 5, 2012 Share Posted December 5, 2012 please use span[face|size|color] I don't think that face, size or color are valid attributes with a <span> tag. It probably doesn't hurt anything to have them in your TinyMCE definition, but I think the only valid one you would need is "style". Is it really working with span[face|size|color], or do you have a span[style] in there too? Link to comment Share on other sites More sharing options...
Joss Posted December 5, 2012 Author Share Posted December 5, 2012 Haven't tried face, but both size and colour work, as it does in normal css Really, it would be nice if it added it to, for instance, the <p> tag, but I can't get it to do that. Checking one of my Joomla installations, it does the same thing: <p><span style="color: #000000; font-size: 20px;>my words</span></p> Shows how little I actually check the source of wysiwyg editors!!! Be interesting to see what other editors do in this case - especially the jquery/html5 editors which is where I think we should be headed for basic editing. Joss Link to comment Share on other sites More sharing options...
ryan Posted December 6, 2012 Share Posted December 6, 2012 In TinyMCE, that span[style] just is a way of saying "allow a <span> tag with a style attribute." Since there aren't such things as a color, size or face attribute for a <span> tag, I think you can safely omit those and just specify span[style]. So that's all I was trying to say in the previous message, is that probably people need to specify span[style] rather than span[face|size|color] in their TinyMCE field. Though I could be wrong, as I've been fooled by TinyMCE many times before. Link to comment Share on other sites More sharing options...
Joss Posted December 6, 2012 Author Share Posted December 6, 2012 I will try later and let you know. I find most editors a pain, to be honest. They all come under a category I call "there has to be a better way to do this" Link to comment Share on other sites More sharing options...
diogo Posted December 6, 2012 Share Posted December 6, 2012 They all come under a category I call "there has to be a better way to do this" Maybe we should open a discussion about this idea from Mindplay, and start an effort to help him out http://processwire.c...ome/#entry19695 Link to comment Share on other sites More sharing options...
Joss Posted December 6, 2012 Author Share Posted December 6, 2012 Hi Diogo Er, link seems unusual.... Link to comment Share on other sites More sharing options...
diogo Posted December 6, 2012 Share Posted December 6, 2012 Oh... Check again please, just edited it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now