Sprites with Concrete5? - RESOLVED
Permalink 1 user found helpful
Is it possible to use sprites with Concrete5? I have a live site and don't want to try doing it if it's going to mess everything up. It seems like, since the CMS controls how the images are implemented, it might conflicts with using image sprites. Does anyone have any experience with this?

I have to admit that I have no clue what you are talking about. Can you give us an example?
I ran my site through GTmetrics and it's recommending image sprites to reduce http requests for several images that I've placed through the CMS. I currently have an F grade in "Combine images using CSS sprites. Some of these images are placed via CSS and some are placed via the CMS, so I'm not sure that I can do anything about this. This is why I'm not sure how to fix this problem. I hope this makes sense.
I had actually never heard of a CSS sprite. They look like something that would be best implemented when the site is being built. I am sure that any images that you have added can be changed to a sprite.
Are you wanting to change some of the images that are part of the theme that you are using to sprites? That should be doable. Same procedure as the other sprites, you would just have to dig into the files of the theme. If you are going to do this, I would make a copy of the theme and rename it to something like theme_sprites or something like that. Then you have a backup of the original theme just incase you mess something up.
Are you wanting to change some of the images that are part of the theme that you are using to sprites? That should be doable. Same procedure as the other sprites, you would just have to dig into the files of the theme. If you are going to do this, I would make a copy of the theme and rename it to something like theme_sprites or something like that. Then you have a backup of the original theme just incase you mess something up.
I decided against doing it as a whole. It's just going to have to be a minor demerit against the site in google rankings. I think you're correct in thinking that I should have done this when I was building the site. This is my first c5 site though, so I guess you live and you learn. thanks for the thought.
Just to confirm, you can use CSS Sprites when building a template as I have done this numerous times (it's a great technique if you use a set of icons throughout the site), but I can't see it being practical to allow users to upload their own images that are to be used as sprites.
concrete5 already uses css sprites. There is nothing to stop you creating your own sprites as a graphic file associated style sheet. But you won't be able to show them via an img block. You will need to load css and then insert html with the css classes for an individual sprite.
The bootstrap icons in the dashboard (and also used by some front end addons) are a single sprite png file and a bunch of css to show individual icons from the sheet.
The same is done with jQuery.UI icons.
Some of c5's own icons are also assembled into a sprite sheet.
My Flags addon uses sprite sheets for some sizes of flags, coupled with a block to select a flag and insert its sprite, with html advice for the snippet to insert for any particular sprite should a user want to insert it directly.
Sprites are a good choice if you have lots of small graphics used all over your site and the overhead of loading a graphic file is significant compared to the actual size of the file.
Once files get larger and/or less of them are used, then at some point the balance tips in favour of loading just the graphics you currently need, rather than all of a monster sprite, 90% of which you dont need.
The bootstrap icons in the dashboard (and also used by some front end addons) are a single sprite png file and a bunch of css to show individual icons from the sheet.
The same is done with jQuery.UI icons.
Some of c5's own icons are also assembled into a sprite sheet.
My Flags addon uses sprite sheets for some sizes of flags, coupled with a block to select a flag and insert its sprite, with html advice for the snippet to insert for any particular sprite should a user want to insert it directly.
Sprites are a good choice if you have lots of small graphics used all over your site and the overhead of loading a graphic file is significant compared to the actual size of the file.
Once files get larger and/or less of them are used, then at some point the balance tips in favour of loading just the graphics you currently need, rather than all of a monster sprite, 90% of which you dont need.
Thanks. This is the answer I was looking for. Hadn't yet used the html block for anything at that point in my C5 learning process. I'll certainly be implementing this in the future.