If extrenal system that is going to be used supports PHP then it is fairly easy to do it.
Step 1:
Create new template in your CMSMS, for example simply named "Blank"
And simply call only stylesheet in there:
Code: Select all
{strip}{content assign='foo'}{cms_stylesheet nolinks=1}{/strip}
Save that Template.
Step 2:
Attach stylesheets you want to use to newly created Template or edit cms_stylesheet tag in step one to include stylesheet with parameter name=
Step 3:
Create new page in your CMSMS and apply your newly created template to that page.
Hide it from menu and save it.
Output of that page would be for example:
Step 4:
Make sure that this page isn't being indexed or something, so edit your robots.txt or well it's up to you
Step 5:
Now simply add few lines of PHP:
Code: Select all
<?php
$url = file_get_contents('http://yourdomain.com/index.php?page=WHATEVER_YOUR_ALIAS_IS'); // url to page to read content from
$data = file_get_contents(trim($url)); // if that page has only one url read that content
$file = md5(serialize($url)) . '.css'; // filename
$cache_file = './cache/' . $file; // cached file and folder
if (!file_exists($cache_file) || filemtime($cache_file) < (time() - 3600)) {
if (!file_exists($cache_file)) {
mkdir('./cache', 0777);
}
file_put_contents($cache_file, $data);
chmod($cache_file, 0664);
$html = '<link rel="stylesheet" href="cache/' . $file . '" type="text/css" />';
} else {
$html = '<link rel="stylesheet" href="cache/' . $file . '" type="text/css" />';
}
echo $html;
?>
Thats it, the output would be:
Code: Select all
<link rel="stylesheet" href="cache/74324b7a7dc71e971e07e8fc3869d8b1.css" type="text/css" />
Basically what was done is reading content of your created page, then reading content of url that we have as content in that page.
After that is done a file is saved in "cache" folder.
If saved file is older then one hour it will be resaved again.