Wednesday 09 June 2010 4:14:37 am - 14 replies
On one site I have to have static images and CSS on a separate hosts (for example images.myhost.com and css.myhost.com). So I would like to use ezjscore extension and the ezcss() template operator to generate the CSS files with the correct URLs to images. But I want this URLs to be full absolute URLs, with hostname, for example:
{ background: url(http://images.myhost.com/design/mysite/images/bottom.gif)}
Can this be done with the ezcss() operator and how?
Tuesday 15 June 2010 2:07:52 pm
Hi Marko,
While i did this on a project, by replacing the ezdesign and ezimage operators directly in the template with other operators (ezdesign_static & ezimage_static), when using ezjscore you may need to dive deeper.
Taking a look at the
ezjscPacker::buildStylesheetTag( .. )
method, and potentially overriding it of possible, could help. A good alternative is to post an enhancement request in this regard, there : http://issues.ez.no/ProjectSelect.php?Id=3
Cheers !
Thursday 17 June 2010 7:23:45 pm
Saturday 19 June 2010 12:31:30 pm
Side note: eZ Publish also supports filters that can be run on the rendered page (pagelayout + module view) as last step.
IIrc the xrowcdn extension uses this feature to rewrite the urls generated by eZ to point them to a CDN.
Might be useful for scenarios where not only the ezjscore urls need to be rewritten (even though I'd go for adding a new tpl operator and use it prepended to ezimage/ezdesign instead)
Sunday 20 June 2010 6:40:59 pm
This is already supported guys!
Take a look in ezjscore.ini [Packer]CustomHosts[]
Andre, I have eZP 4.1.3 and I don't have this setting in ezjscore.ini. From which version is available?
Another question: Will this work without problems for font urls in CSS? (thinking of @font-face)
Sunday 20 June 2010 6:45:24 pm
Gaetano, I know about xrowcdn and I'm already planning to use it. The only question is if I can use it with my "kind of" CDN. I posted the question in the forum:
http://projects.ez.no/xrowcdn/forum/general/is_custom_cdn_possible
and I'm waiting for an answer.
In addition: where can I find some docs about this filters that can be run on the rendered page?
Thursday 24 June 2010 1:55:24 am
Hi Hubert,
xrowcdn can work fine for your need, I was just looking for this too. This is how i did.
Install the xrowcdn extension
In the xrowcdn.ini file I changed all the Replacement=http://<uniquecloudfrontname>.cloudfront.net with the url I have for "my" own cdn and put put UseGZIP=enabled
I've added the OutputFilter in my siteaccess site.ini file
Backuped the db just in case
generate the autoload again
emptied the cache, and it was ok.
Hope it helps,
Nicolas
Tuesday 06 March 2012 4:19:08 pm
Quote from André R :This is already supported guys!
Take a look in ezjscore.ini [Packer]CustomHosts[]
I tried this on an eZ Publish 2011.9 installation, but it only half worked. With:
[Packer] CustomHosts[.css]=http://media2.example.com CustomHosts[.js]=http://media1.example.com
Only the Javascript URLs are changed. I looked at the PHP in ezjscore and couldn't see any reason why it might be ignoring the CSS setting.
Any ideas?
Thursday 12 July 2012 2:56:38 pm
Quote from Andy Caiger :Quote from André R :This is already supported guys!
Take a look in ezjscore.ini [Packer]CustomHosts[]
I tried this on an eZ Publish 2011.9 installation, but it only half worked. With:
[Packer] CustomHosts[.css]=http://media2.example.com CustomHosts[.js]=http://media1.example.comOnly the Javascript URLs are changed. I looked at the PHP in ezjscore and couldn't see any reason why it might be ignoring the CSS setting.
After experiencing the same thing, and a bit of investigation, I can see the problems:
So there are two solutions:
Cheers,
Geoff
Modified on Friday 13 July 2012 2:21:37 pm by Geoff Bentley
You must be logged in to post messages in this topic!