Administrator - Editor issue. Editor looks different to templtae - JCE

Ecommerce design Joomla template to start your online business with VirtueMart and additional eshop features.
GK User
Sun Feb 13, 2011 1:13 pm
Hey,

I'll preface by saying that I love Gavick work, anyway I have a small issue I thought id ask about.

Short version:

When i select "Use Template CSS" in JCE, it does not show the template CSS from a Gavick template in the editor. Is there a way you can make the editor use the template CSS easily?

I can understand this may not be 100% supported issue as TinyMCE does not have the 'use template css' function, and JCE is technically a 3rd party plugin and does not need to be supported, but I think most developers will agree this could be a common problem.


Long version:

The administrator and template use different css files. When you install templates these again use different CSS files.

So when you say install a Gavick template, the css files it uses to create the layout are not by default going to show in a content editor such as tinymce or jce.

This is a somewhat unusual behavior because with many templates, JCE is able to automatically acquire the template css and display it in the editor. One assumption I have on that gavick could be using of constants from the template parameters and doing inline styles via PHP, therefore when JCE loads the styles, it is missing the font styles.

Anyway, I was wondering if anybody has any ideas on this. Its definately possible I'm just not using JCE properly or i'm overlooking something.

The big things include: font-family, font-size, letter-spacing, line-height, h1, etc.

------------

Thank you very much for any ideas and support.

Best Regards
User avatar
Fresh Boarder

GK User
Sun Feb 13, 2011 6:12 pm
Hi,

Go to your templates css directory and create a new file called editor_css.css there may already be a file with a similar name. Open the typography.css file for your template and copy the contents in to the editor_css.css file. You can also add styling for body at the start of the file - this will allow you to set the background colour etc.

Save the file and go to the JCE editor config where it says Use template CSS Y/N select No the next line is the path to the css file you want JCE to use e.g. templates/$template/css/editor_css.css set the correct path and save.

Now when you use the editor, you should see the styling applied when using the templates typography options. If you changed the body colour the body should be the same colour etc.
User avatar
Expert Boarder

GK User
Tue Feb 15, 2011 4:56 pm
Thank you for the help sounds great.

Using other template mobs I have sometimes added some custom styles in a way similar to you mentioned, I was just curious about Gavick support for JCE specifically.

After i posted last time i did a fair bit of research and it seems that Gavick developers tend to favor tinymce over JCE due to bugs and issues over the years. IMO though, I think we can all agree JCE has gotten significantly better over the years with the solutions for things like Copy + Paste, IE issues and more.

----

Your solution seems like a tight fix and good, I'm curious about one part though, when you apply styles to your template using the Joomla - Administrator - Template - Parameters, do they get dynamically written into your typography.css file?

If that occurs it would be sweet, otherwise we might be missing any google font library etc with your method. I thought the typical method would be the google font options etc to be stored in a params.ini file, therefore even if you copied your typography.css it would be missing some key information. The params.ini is then parsed at page inception, written inline and then cached.

Its not huge though, I mean you get 99% of it using typography and I suppose you could manually put in anything that is written inline using php.

I know at least for example the page features are done inline, because I have noticed that inline style in doing a brief scan of the template constructor. My main reason in posting was to just have a developer rattle from the top of his head whether I am to handle this manually or there is some intuitive way for your editor to look like the Gavick template.

Can you explain if your solution is comprehensive and if/what is done inline if you know that part?

Thanks again.
User avatar
Fresh Boarder


cron