benjamin-vauchel / SmartOptimizer

This extra is a MODx version of SmartOptimizer by Ali Farhadi (http://farhadi.ir/works/smartoptimizer), a PHP library that enhances your website performance by optimizing the front end using techniques such as minifying, compression, caching, concatenation and embedding.
5 stars 0 forks source link

wrong slashes #6

Open Triplethread opened 12 years ago

Triplethread commented 12 years ago

Hello Benjamin, thank you for your plugin! I am on revo 2.2.0 pl2

I have download it today as package 1.0.0 pl Hope it is the right one? In backend is announced under information:

--------------------
SmartOptimizer
--------------------
Version: 1.0.0-beta3
Released: January 19, 2012
Since: December 20, 2011
Author: Benjamin Vauchel <contact@omycode.fr>

I am using your 1st method of embedding

<!-- Your CSS files -->
<link rel="stylesheet" href="assets/css/file1.css"/>
<link rel="stylesheet" href="assets/css/file2.css"/>
<!-- Your CSS files -->
<link rel="stylesheet" href="[[SmartOptimizer? &files=`assets/css/file1.css,file2.css`]]"/>

So I place my CSS in my template header:

[[SmartOptimizer? &files=`assets/foundation/stylesheets/foundation.css,assets/foundation/stylesheets/app.css`]]

After parsing I get this in frontend:

/assets/components/smartoptimizer/connector.php?assets%2Ffoundation%2Fstylesheets%2Ffoundation.css%2C+assets%2Ffoundation%2Fstylesheets%2Fapp.css

I see 2 problems: a) path slashes of my CSS are not interpreted right b) the path to connector.php is relative

benjamin-vauchel commented 12 years ago

Hi Triplethread,

First, you have the right package. I just forgot to update the version number. ;) Then, a) Slashes are encoded for URL. Don't worry, it's the regular behavior b) the URL to the connector is based on the "asset_url" MODx property. c) If you want to add multiple CSS files (in your case, foundation.css and app.css) they have to be in the same directory and you don't have to repeat the CSS path. Your snippet call will be :

[[SmartOptimizer? &files=`assets/foundation/stylesheets/foundation.css,app.css`]]

Is that worked ? What kind of error do you have ?

Triplethread commented 12 years ago

Hello Benjamin, sorry for my late answer and thank you very much for your quick responce!!

a) ok! b + c) hope, my assets_url is correct since install process?

But if I paste into my template header

then comes:

If I paste in:

then comes (shit, double slashes!):

Again, thank you for assist!

PS: my test installation is here: http://knud.aquarius.uberspace.de/ full site will become: http://www.htbu-ev.de/modx/