SnippetMaster Support Forums
Return to main website
 
January 28, 2009, 11:25:22 PM
* Show unread posts since last visit.
* Show new replies to your posts.
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 28, 2009, 11:25:22 PM

Login with username, password and session length
Search:  
Advanced search
* Home Help Search Login Register
SnippetMaster Support Forums  |  General  |  General Discussion & Support  |  Topic: Referring to a CSS file from a PHP include? « previous next »
Pages: [1] Print
Author Topic: Referring to a CSS file from a PHP include?  (Read 1535 times)
daveozzz

Posts: 10


[-] Referring to a CSS file from a PHP include?
« on: April 23, 2007, 05:45:50 AM »

Hi,
I'm probably going to use the PRO version to allow a client to edit basic html content which I PHP include into the main site from txt files (due to being slightly paranoid about 666'ing php files.).

So I'd have in the main body PHP file:

   <div id="content">
      <?php include("user/home_main_body.txt"); ?>
   </div>

And in user/home_main_body.txt would be the user editable text (surrounded by Snippet tags) which would consist of basic headings, lists etc.

The downside of doing it this was is that Snippetmaster doesn't know about site's stylesheet because there's no
<head> containing <link rel="stylesheet"... in the file Snippetmaster is editing.

Has anyone got any suggestions how I can make Snippetmaster aware of the site CSS without having the user edit within the parent PHP file?

Thanks in advance for any help.
Regards,
Dave Osborne
Report to moderator   Logged
admin
Forum Administrator
*
Posts: 2472

SnippetMaster Author


WWW
[-] Re: Referring to a CSS file from a PHP include?
« Reply #1 on: April 23, 2007, 08:40:41 AM »

Hi Dave,

At the moment, there is no way to manually specify a style sheet from within SnippetMaster.

The only thing you could do is force snippetmaster to use your styles when the editor is displayed, by adding them to the "/snippetmaster/includes/tiny_mce/themes/advances/css/content.css" file.

The CSS styles in that file are loaded into the editor when it is displayed, so that might do the trick. 

I will be adding the ability to specify a stylesheet file as a new feature.. eventually.
Report to moderator   Logged
daveozzz

Posts: 10


[-] Re: Referring to a CSS file from a PHP include?
« Reply #2 on: April 23, 2007, 12:14:20 PM »

That could well do the trick since it's mostly just the <blockquote> appearance I want to change.

I couldn't get editing the stylesheet to make any difference.. can you check I'm doing this right..
In .....\includes\tiny_mce\themes\advanced\editor_content.css I should be able to add a style like:-

blockquote {background:url(img/menubg.gif) repeat-x bottom left #f4f4f4; border-bottom:1px solid #d8d8d8; border-left:4px solid #ccc; border-right:1px solid #d8d8d8; border-top:1px solid #d8d8d8; color:#505050; margin:16px; padding:7px 7px 7px 11px;}

..and it should show up in the editor window?

Cheers for the response.
Dave
Report to moderator   Logged
admin
Forum Administrator
*
Posts: 2472

SnippetMaster Author


WWW
[-] Re: Referring to a CSS file from a PHP include?
« Reply #3 on: April 23, 2007, 12:21:46 PM »

I'm pretty sure it's the "editor_content.css" file, but maybe try the other "editor_ui.css" and see if that does anything.

Report to moderator   Logged
admin
Forum Administrator
*
Posts: 2472

SnippetMaster Author


WWW
[-] Re: Referring to a CSS file from a PHP include?
« Reply #4 on: April 23, 2007, 12:22:29 PM »

Try changing/adding the BODY element in that css file and see... that should be a way to change the background color of the editor, too...

Report to moderator   Logged
daveozzz

Posts: 10


[-] Re: Referring to a CSS file from a PHP include?
« Reply #5 on: April 23, 2007, 01:20:15 PM »

Strange.. I can't get either of the editor_*.css to make a difference.

I'm still using the Lite version btw... this isn't a feature only available in PRO is it?

Otherwise, perhaps the editor isn't rereading the css after I changing it.. but I'm logging out and back in - even restarting Apache. Puzzling.
Report to moderator   Logged
admin
Forum Administrator
*
Posts: 2472

SnippetMaster Author


WWW
[-] Re: Referring to a CSS file from a PHP include?
« Reply #6 on: April 23, 2007, 01:31:35 PM »

No, it should work for both LITE and PRO version.

Is it possible to send me your FTP un/pw info for the snippetmaster folder, and also a snippetmaster login un/pw and I'll login and see if I can figure it out?

henri at www.snippetmaster.com
Report to moderator   Logged
daveozzz

Posts: 10


[-] Re: Referring to a CSS file from a PHP include?
« Reply #7 on: April 23, 2007, 02:16:26 PM »

Thanks. I appreciate the offer but I'm currently developing on my local PC running a WAMP server so I don't have an FTP server installed.
I'll plug away at it a bit more tomorrow and see if I can work out what's going on. Thanks again..
Report to moderator   Logged
Jenkinhill
Beta Tester

Posts: 368



[-] Re: Referring to a CSS file from a PHP include?
« Reply #8 on: April 23, 2007, 02:17:05 PM »

Henri, I have found this problem, too. The editor_content.css file makes no difference. Researching this there is a requirement to use a line such as
 
content_css : "../include/javascript/tinymce/themes/advanced/css/editor_content.css",

in tinyMCE.init - but we don't have control over that. It suggests to me that perhaps there should be a switch to use that file rather than a style sheet linked to the page, as it does not seem to be automatic?

The Wiki also mentions using a class mceContentBody - but I got lost there!
Report to moderator   Logged

Kelvyn
admin
Forum Administrator
*
Posts: 2472

SnippetMaster Author


WWW
[-] Re: Referring to a CSS file from a PHP include?
« Reply #9 on: April 23, 2007, 02:20:34 PM »

Hi Kelvyn,

The "content_css" in the tinyMCE init section is for specifying an additional CSS file for styles.

The editor, by default, will load the "editor_content.css" file in the advanced theme folder.  This is how it styles the editor, toolbar, etc.. when no "content_css" is specified.

So it goes in this order for styles:

1) themes/advanced/css/editor_content.css
2) content_css value in tinyMCE init

So if you specify a "BODY" style in an external stylesheet and then specify that in the content_css value in the tinyMCE init.. it will have higher priority then a BODY style in the editor_content.css file in the themes folder.

Hope that makes sense.

Report to moderator   Logged
daveozzz

Posts: 10


[-] Re: Referring to a CSS file from a PHP include?
« Reply #10 on: April 24, 2007, 01:53:46 AM »

So is there something over-riding the body clause in snippetmaster\includes\tiny_mce\themes\advanced\css\editor_content.css  ?

Just in an effort to test this I tried to change the background colour to red

body {
   background-color: #FF0000;
}

... but no change in the editor.


The whole point of why I'm doing this is to try to get the <blockquote> tag to actually look like a blockquote as opposed to an indent... so any suggestions on that would be more than helpful also.
Report to moderator   Logged
Jenkinhill
Beta Tester

Posts: 368



[-] Re: Referring to a CSS file from a PHP include?
« Reply #11 on: April 24, 2007, 02:06:34 AM »


Hope that makes sense.


Yes, it makes sense and I'm sure that is the way it worked in beta testing, but it does not appear to work now - in FireFox, but it does work in IE6. So are we looking at a browser cache problem? I'll test this shortly.

Added: OK, I can confirm that this is a css caching issue that I am seeing. Using Opera it is possible to see what files are cached and also to clear them relatively easily. I'll think some more about this!
« Last Edit: April 24, 2007, 03:21:03 AM by Jenkinhill » Report to moderator   Logged

Kelvyn
daveozzz

Posts: 10


[-] Re: Referring to a CSS file from a PHP include?
« Reply #12 on: April 26, 2007, 11:14:38 AM »

I've finally caught up with what you were saying... yeah changing editor_content.css works a dream in IE.
Just not Firefox for some reason.
Report to moderator   Logged
admin
Forum Administrator
*
Posts: 2472

SnippetMaster Author


WWW
[-] Re: Referring to a CSS file from a PHP include?
« Reply #13 on: April 26, 2007, 11:59:30 AM »

Hmm.. not sure.  I think this might be a caching issue, then.   Can you clear the cache in firefox and see if that makes a difference?

Report to moderator   Logged
Jenkinhill
Beta Tester

Posts: 368



[-] Re: Referring to a CSS file from a PHP include?
« Reply #14 on: April 26, 2007, 01:40:14 PM »

I came across a Clear Cache Button extension for FireFox which provides a quick way to clear the whole cache, but even better, there is a way to just clear the cached css for just a single page - and it works. See here.

I have not tried this with SnippetMaster yet, but it certainly worked for a site where I was having to make some subtle CSS changes.
Report to moderator   Logged

Kelvyn
daveozzz

Posts: 10


[-] Re: Referring to a CSS file from a PHP include?
« Reply #15 on: April 26, 2007, 10:17:42 PM »

Nice little script.. but I couldn't get it to work with Snippetmaster.
Report to moderator   Logged
thegoogoodoll

Posts: 1


[-] Re: Referring to a CSS file from a PHP include?
« Reply #16 on: October 11, 2007, 02:27:43 PM »

It woulld be great to be able to refer to a CSS file from a PHP-include... so.. Did anyone actually get it to roll? In that case, how?
Thanx/ Rickard
Report to moderator   Logged
jean

Posts: 6


[-] Re: Referring to a CSS file from a PHP include?
« Reply #17 on: January 11, 2009, 06:12:56 PM »

css cache control has driven me nuts so now whenever i'm making css changes/testing i include

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> <!-- don't cache this page-->
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"><!-- don't load this page from the cache-->

and that has solved many problems.

Just don't forget to change it back after you are done or your users will not get the speed benefit of your css being cached on your site.
Report to moderator   Logged
Pages: [1] Print 
SnippetMaster Support Forums  |  General  |  General Discussion & Support  |  Topic: Referring to a CSS file from a PHP include? « previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!