Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there any way to use theme CSS from screen.css inside of CKEditor ?
#1
May be I do somethig wrong, but I can't obtain a truly WYSISWYG in CKEditor while editing pages Sad

My CKEditor completely ignores themes screen.css file. It doesn't display pages according to content of theme screen.css and in styles combo box selector instead of styles from screen.css, I see only abstract useless styles.

So - subj: Is there any way to use theme CSS from screen.css inside of CKEditor ?
If yes - please descride what I must to do or give a links with such descriptions.
Reply
#2
search the forum! There are posts on this topic already
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#3
Connie Wrote:search the forum! There are posts on this topic already
I am always search any forum before asking my question
The only one informative link I was found - http://get-simple.info/forum/topic/2605/...in-editor/
But as I can see, the solution is in hardcoding config files of CKEditor. It is not right way.
Suppose that I support 3 different sites with different design Wink So before editing first one I must "patch" CKEditor with one styles, then before start work with next site with another design - I must "apply another pacth" and so on... ?!

May be there is another way? This is basic feature (WISIWYG) of Get-Simple but it is not work without "hand magic"? Wink
Reply
#4
zencoder Wrote:May be there is another way? This is basic feature (WISIWYG) of Get-Simple but it is not work without "hand magic"? Wink

There can not be an automatic way, because
  • the CSS file name differs between themes (in your theme it seems to be screen.css, but in others it's styles.css or default.css)
  • you could have multiple themes installed, but only one can be used in the editor
  • in most cases you need special rules for the editor (e.g. if your theme sets big margins or a fixed width for the content area)
  • etc.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#5
mvlcek Wrote:There can not be an automatic way, because
I see... but, as I know editining page it is an ordinary HTML page. This page created "on the fly" when I start editing from GS. Is it possible to "insert" into it one more style sheet? It may be placed on a fixed folder (thomething like ThemeStyle). Before I begin any work with site, I just copy to this folder content of themes files (screen.css, images folders, etc). So when editing page will created it will be use pre-prepared styles from this folder. The only problem is the name of css file

Quote:* the CSS file name differs between themes (in your theme it seems to be screen.css, but in others it's styles.css or default.css)

but it much more easy create template with fixed css file name (like screen.css) or simply edit existing desing replace somekind of styles.css with fixed screen.css. But editor ALWAYS will show WYSISWYG! The only dificult - applaying custom styles to the text. But it can be entered in pure HTML-mode.

Quote:you could have multiple themes installed, but only one can be used in the editor
this can be solved by providing combo box (like in selecting design) in page for editing form.
Reply
#6
I am not a master of PHP and cant check this solution. Can any PHP-guru check is it possible to do inside GS?
http://bestsites.ro/how-to-load-external...-with-php/
Reply
#7
Yes! It is working!!!!
just place inside theme directory duplicate of your css file with the name editor.css (or simply use this name in you template) Smile)
Reply
#8
your suggestion is not the correct solution for the problem, as this directive is read when the calling programme (GetSimple) instantiates / starts the Editor
so what when you switch a theme?

I found one working solution / workaround:

the default css-file for the editor is the file admin\template\js\ckeditor\contents.css

if you need a fast solution, you can copy the content of your css-file into that file and upload it to the defined destination

I tested with
Code:
body {
    color: #416a8b;
    font-family: Arial;
    font-size: 18px;
    font-weight: 400;
   text-align: left;
}

instead of the default-body-definition there and I got that blueish big letters in Arial as the default text-formatting

I tried to add a directive to the custom-config-file of CKEditor in GS (see the wiki), but to no avail until now

as I said, this is a fast workaround if you stick with one theme
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#9
zencoder Wrote:Yes! It is working!!!!
just place inside theme directory duplicate of your css file with the name editor.css (or simply use this name in you template) Smile)

you will have to add the classes to the style-combobox if you want to use the complete formatting definitions from your css and to delete those which you do not want

see here: http://get-simple.info/wiki/how_to:edito...stylesheet
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#10
It seems to me that it can be builtin directly inside of GS engine.
In file \admin\edit.php in line 316 we can see command which check existing of editor.css
if (file_exists(GSTHEMESPATH .$TEMPLATE."/editor.css"))
and in line 319 - just loading editor.css.
contentsCss: '<?php echo $fullpath; ?>theme/<?php echo $TEMPLATE; ?>/editor.css',
may be it will be better, before this, obtain list of css files available in theme directory and load not dummy editor.css but a real css-file with its original name?
The only problem - more than one css file in dir. But it cam be (IMHO) solved by adding combobox selector in page properties area where user can select the right one or do not use this file at all.

Can anybody inform developers about my suggestion? It seems not so dificult to realese such great feature Wink
Reply




Users browsing this thread: 1 Guest(s)