Page 1 of 2

What is a direct link to a stylesheet?

Posted: Thu Apr 12, 2012 10:37 pm
by Augustas
I would like to import CSS style saved in CMSMS into an external website.

With the old {stylesheet} tag there was a possibility to call stylesheet in this way:
/stylesheet.php?cssid=42

Now, when there is only {cms_stylesheet} tag, and "stylesheet.php" was removed, is there any way to get a direct link to the CSS file?

Thank you,
Augustas

Re: What is a direct link to a stylesheet?

Posted: Thu Apr 12, 2012 10:45 pm
by scelle
I don't think you can link directly, because the CSS code is stored in the database and then compiled and temporarily cached in the 'tmp/cache' directory. That file is being deleted and recreated randomly (during cache clearing).

There are some modules that can export your theme into files, though, look them up at The Forge.

Re: What is a direct link to a stylesheet?

Posted: Fri Apr 13, 2012 2:08 am
by Wishbone
You can always copy stylesheet.php from an older install.

Re: What is a direct link to a stylesheet?

Posted: Fri Apr 13, 2012 5:07 am
by RonnyK
you can use name= to call the stylesheet with a specific name...

Ronny

Re: What is a direct link to a stylesheet?

Posted: Fri Apr 13, 2012 7:32 am
by Augustas
RonnyK wrote:you can use name= to call the stylesheet with a specific name...
Ronny, could you write an example of full URL?
"name=" is just a parameter for the URL.
But which .php file I should call?

Re: What is a direct link to a stylesheet?

Posted: Fri Apr 13, 2012 7:34 am
by Augustas
Wishbone wrote:You can always copy stylesheet.php from an older install.
I don't think it is a good idea, as officially this file is not anymore inside the CMSMS distribution, so I prefer not to stick to old codes for security and compatibility reasons.

Re: What is a direct link to a stylesheet?

Posted: Fri Apr 13, 2012 8:04 am
by RonnyK
The stylesheet is not a 'file'. It is generated during the call. And with the caching/combining that is happening, is the stylesheet created/stored and called from the cache folder.

If you want a static file for CSS, then you could copy/paste the data to a static file, and call it as a static file, so not using the stylesheet-db logic....

But I dont see the specific use for calling a 'file'...

Ronny

Re: What is a direct link to a stylesheet?

Posted: Fri Apr 13, 2012 8:24 am
by Augustas
RonnyK wrote:The stylesheet is not a 'file'. It is generated during the call. And with the caching/combining that is happening, is the stylesheet created/stored and called from the cache folder.
Not sure you understood my initial question.

I wish to have a direct link to the CSS file, which I could use in another website. Namely, a company has CMSMS site and Wordpress blog. My wish is - in both CMS systems (cmsms and wp) to use the same stylesheet file. I.e. in case an update in CSS is needed - then it could be done just in one place - e.g. in CMSMS, and all the style changes are reflected automatically in Wordpress page.

Obviously I cannot use {cms_stylesheet name='xxx'} code in Wordpress templates. So with older CMSMS versions I used to call CSS file with:
/stylesheet.php?cssid=47

Since CMSMS 1.10 stylesheet file has a temporal URL like this:
/tmp/cache/stylesheet_combined_89f4e8cbdcb9415f0f04ff04d6cf58e5.css

But this URL is only temporal and once cache is refreshed -- this file will not exists anymore. That is why I am asking if there is any other way to have a permanent & direct link to CMSMS stylesheet. And when CSS changes are made in CMSMS Admin -- then those changes would be instantly visible in Wordpress blog which is importing CMSMS stylesheet.

I hope my situation got some more clarity.

Thank you :)

Re: What is a direct link to a stylesheet?

Posted: Fri Apr 13, 2012 8:37 am
by RonnyK
OK..

then I think that you could go with a static stylesheet, which is not maintainable from the backend, but can be called with the..

<LINK HREF="basis.css" REL="stylesheet" TYPE="text/css">

so instead of a db-stylesheet, just take the content of the generated one that you mentioned, put the content in a static file under /uploads, and link with a static css-call to that file.

Ronny

Re: What is a direct link to a stylesheet?

Posted: Fri Apr 13, 2012 8:42 am
by Augustas
RonnyK wrote:then I think that you could go with a static stylesheet, which is not maintainable from the backend, but can be called with the..

<LINK HREF="basis.css" REL="stylesheet" TYPE="text/css">
This is exactly how I do it now.
Which means someone has to keep an eye on CSS changes made in CMSMS, and once there are some changes - the static stylesheet for Wordpress should be updated manually...

Re: What is a direct link to a stylesheet?

Posted: Fri Apr 13, 2012 9:03 am
by RonnyK
Or you call it in CMSMS itself from the static one as well....

Re: What is a direct link to a stylesheet?

Posted: Fri Apr 13, 2012 9:08 am
by Augustas
RonnyK wrote:Or you call it in CMSMS itself from the static one as well....
Yeah, that's an idea!

Re: What is a direct link to a stylesheet?

Posted: Fri Apr 13, 2012 10:10 am
by mcDavid
I think using the old stylesheet.php file for this would actually be a very good solution. It provides you with exactly the script you need to use a CMSMS stylesheet on a different website.

Of course, you can still use the new and modern {cms_stylesheet} tag on your CMSMS website.

Re: What is a direct link to a stylesheet?

Posted: Fri Apr 13, 2012 10:17 am
by Augustas
mcDavid wrote:I think using the old stylesheet.php file for this would actually be a very good solution.
But using this old file does not guarantee that with the next CMSMS update this old stylesheet.php code will work. Looking to the long-run, I think best would be to avoid old version codes.

Re: What is a direct link to a stylesheet?

Posted: Fri Apr 13, 2012 10:42 am
by mcDavid
There will never be any way to guarantee any kind of compatibility with other CMS's in the future. You will always have to maintain that yourself.