You are not logged in.
Pages: 1
I'm using xinha nightly release downloaded today (30 March).
I want to make an x-area where I've locked down the formatting (i.e. the user cannot change the text font, size or style - I just want them to be able to bold, hyperlink and similar things).
I've used
xinha_config.toolbar =
[
["bold","italic","separator"],
["insertorderedlist","insertunorderedlist","outdent","indent","separator"],
["inserthorizontalrule","createlink"],
["undo","redo"], (HTMLArea.is_gecko ? [] : ["cut","copy","paste"]),["separator"],
["killword","removeformat","separator","htmlmode","about"]
];
in the <HEAD> tag of my web page, and that works correctly to give me what I want.
So now I would like to change the default display font and size of my x-area. I've tried
xinha_config.pageStyle = 'font-family: verdana,sans-serif; font-size: 11px;';
based on experience with htmlArea2, but it isn't working.
Any suggestions please?
Last edited by Martin_Edney (2005-03-30 13:44:24)
Offline
you must use complte css-statements (including selector and rules)
for example like this:
xinha_config.pageStyle = 'body { font-family: verdana,sans-serif; font-size: 11px; }';
or
xinha_config.pageStyle = 'h1 { font-family: verdana,sans-serif; font-size: 12px; }';
Niko
Offline
Thanks Niko, that's got it working nicely.
Offline
Where do you put xinha_config.pageStyle = 'h1 { font-family: verdana,sans-serif; font-size: 12px; }'; for it to effect the textarea in use.
Does this go in the config.js of the editor your using, in the htmlarea.js, where?
Offline
In your config.js
Offline
Hi,
I know this is an old thread, but I'm trying to do the same thing (change the default font size) and was wondering if someone could go into a little more detail on how to do this (I'm not familiar with the DOM or previous CMS). For instance, in config.js I assume you mean my_config.js? Does it matter where in the page you insert this line? Do you need any other code besides this line xinha_config.pageStyle = 'body { font-family: verdana,sans-serif; font-size: 11px; }';? I've tried pasting it into my_config.js right after step 5 but it does not work. Thank you.
Offline
Just put it in the section that determines the default configuration in my_config.js like so :
xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();
xinha_config.pageStyle = 'body { font-family: arial,sans-serif; font-size: .9em; }';
xinha_config.width = '100%';
xinha_config.height = '420px';
xinha_config.statusBar = false;
I used em so the font will resize if the user uses a different text size.
Offline
Is it possible to use this method but use a CSS class (from a .css file) instead of explicitely setting the style in the config line?
Offline
You might consider to use a CSS file and include it with
xinha_config.pageStyleSheet = [ 'myFirstCSSFille', 'mySecondCSSFile' ];
Offline
But how do you tell xinha which CSS class it should use as the default for its font etc?
Offline
For instance by putting this in 'myFirstCSSFile':
body {
font-family: sans-serif;
font-size: 12px;
}
Offline
Pages: 1