michael-e / admin_css_override

An extension to the Symphony XSLT Content Management System.
http://symphony-cms.com/download/extensions/view/22295/
Other
5 stars 8 forks source link

Assets Location #2

Open nilshoerrmann opened 11 years ago

nilshoerrmann commented 11 years ago

Would it be possible to load the custom styles from the workspace folder (e. g. /workspace/backend/override.css)? This way, I wouldn't have to change the extension itself.

michael-e commented 11 years ago

Wouldn't this mean that the folder must be created during installation? I like simple extensions :-) Well, we might, of course, simply add it to the documentation...

This is how my typical workspace looks like:

There are two hard things in programming: Invalidating the cache and naming things.

Yep, at the moment I have no idea about the best "convention". Do you think that backend nails it?

nilshoerrmann commented 11 years ago

I like simple extensions

This could be a simple check if a file exists in a defined folder in the workspace. It's an option, nothing that should be created automatically.

Do you think that backend nails it?

Backend, admin, symphony - something along that ...

michael-e commented 11 years ago

Sure? If I have assets, datasources, events etc.?

Maybe it would be the simplest thing to stick to the extension's name (like email-newsletters does, and email-templates alike). So admin-css would probably fit.

Another thought: I am not using this anymore. Instead I created an extension that loads CSS as well as JavaScript. The combination is much more useful. Maybe I should retire this extension and release the new one as Open Source? (I will update my biggest site to Symphony 2.3, and when I do so some extensions will be "modernized".)

I am still on holidays, so be prepared for ridiculous speed in either case.

nilshoerrmann commented 11 years ago

Maybe I should retire this extension and release the new one as Open Source?

Sounds nice.

michael-e commented 11 years ago

So I put this on the list.

michael-e commented 11 years ago

@nilshoerrmann, it looks like there is already an extension which loads JavaScript and CSS. So I am really hesitant to release the same thing.

What do you think?

nilshoerrmann commented 11 years ago

So I am really hesitant to release the same thing.

I just looked at the extension you are linking to and yours is much cleaner.

michael-e commented 11 years ago

Still, there is some sort of general agreement to not release several extensions doing the same thing, right?

I am on my way to update all my private extensions for Symphony 2.3, so I will contact you in a few days (when I have a working version). Then we can decide what to do.

michael-e commented 11 years ago

OK, I am willing to create an open source extension from what I have. I suggest to name it Backend Assets. The assets' location will be hardcoded in the extension, but no files will be created on installation or update. Instead the README will state where the files should be:

(Having no files there wouldn't do any harm to the rendering of backend pages. You might simply notice errors in the Browser's debugging console.)

Using the assets-backend folder would fit nicely into a popular (i.e. my popular) workspace folder naming scheme:

What do you think?

Just a remark: If you want to include additional JavaScript (e.g. Chosen) into your backend, you will have to hack the extension anyway to include these additional files—unless you copy everything to the default files, which may not be the cleanest solution.

nilshoerrmann commented 11 years ago

I like the name of the extension and the folder. But what about not predefining the file names and looping over the folder instead, appending all files ending either on .css or .js.

michael-e commented 11 years ago

That wouldn't work as intended for jQuery plugins. Download packages often contain a foo.min.js file and a foo.js file, and there might even be a Prototype or standalone version of the script in some cases. You may put the whole package in your folder, but you wouldn't want to load all files.

So, no: We shouldn't make assumptions. :-)

nilshoerrmann commented 11 years ago

I though of it more like a convention, not an assumption.

michael-e commented 11 years ago

OK, let's guess the number of mistakes people will make with this convention and without it.

I don't have the time right now to make things complicated. The main advantage is having your additional assets in the worksapce folder. The extension will allow this anyway. Regarding complex setups with jQuery plugins etc., I really assume that you can hack the extension to include any needed files. Your daily workflow will still be easy.

Phone?

nilshoerrmann commented 11 years ago

Heut ist schlecht, morgen ginge.

michael-e commented 11 years ago

OK.