What is a direct link to a stylesheet?

General project discussion. NOT for help questions.
User avatar
Augustas
Forum Members
Forum Members
Posts: 241
Joined: Wed Oct 17, 2007 6:09 pm
Location: the world

What is a direct link to a stylesheet?

Post 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
scelle
Forum Members
Forum Members
Posts: 81
Joined: Sun Apr 24, 2011 8:14 pm
Location: Montenegro

Re: What is a direct link to a stylesheet?

Post 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.
Wishbone
Power Poster
Power Poster
Posts: 1369
Joined: Tue Dec 23, 2008 8:39 pm

Re: What is a direct link to a stylesheet?

Post by Wishbone »

You can always copy stylesheet.php from an older install.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: What is a direct link to a stylesheet?

Post by RonnyK »

you can use name= to call the stylesheet with a specific name...

Ronny
User avatar
Augustas
Forum Members
Forum Members
Posts: 241
Joined: Wed Oct 17, 2007 6:09 pm
Location: the world

Re: What is a direct link to a stylesheet?

Post 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?
User avatar
Augustas
Forum Members
Forum Members
Posts: 241
Joined: Wed Oct 17, 2007 6:09 pm
Location: the world

Re: What is a direct link to a stylesheet?

Post 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.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: What is a direct link to a stylesheet?

Post 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
User avatar
Augustas
Forum Members
Forum Members
Posts: 241
Joined: Wed Oct 17, 2007 6:09 pm
Location: the world

Re: What is a direct link to a stylesheet?

Post 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 :)
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: What is a direct link to a stylesheet?

Post 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
User avatar
Augustas
Forum Members
Forum Members
Posts: 241
Joined: Wed Oct 17, 2007 6:09 pm
Location: the world

Re: What is a direct link to a stylesheet?

Post 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...
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: What is a direct link to a stylesheet?

Post by RonnyK »

Or you call it in CMSMS itself from the static one as well....
User avatar
Augustas
Forum Members
Forum Members
Posts: 241
Joined: Wed Oct 17, 2007 6:09 pm
Location: the world

Re: What is a direct link to a stylesheet?

Post by Augustas »

RonnyK wrote:Or you call it in CMSMS itself from the static one as well....
Yeah, that's an idea!
mcDavid
Power Poster
Power Poster
Posts: 377
Joined: Tue Mar 31, 2009 8:45 pm
Location: Delft, Netherlands

Re: What is a direct link to a stylesheet?

Post 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.
User avatar
Augustas
Forum Members
Forum Members
Posts: 241
Joined: Wed Oct 17, 2007 6:09 pm
Location: the world

Re: What is a direct link to a stylesheet?

Post 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.
mcDavid
Power Poster
Power Poster
Posts: 377
Joined: Tue Mar 31, 2009 8:45 pm
Location: Delft, Netherlands

Re: What is a direct link to a stylesheet?

Post 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.
Post Reply

Return to “General Discussion”