Search

I’m going to be using Symphony for a small site, with a few pages and some entries in a few of those pages. There won’t be that many entries, and each will be more like a page rather than, say, a blog post. They’re going to each have a separate stylesheet. New entries would get their own stylesheets as well.

I see two ways of doing this. One is to have, for each entry, a text box where I can paste the CSS and then use a data source to get it directly. Another is to have the CSS in a separate file, uploaded to the entry.

Which one works better? Or are there other options? The style sheets will be using background images and such for different entries, and I’m not sure what the best way of storing/associating those would be. And also, the hosting charges by the amount of bandwidth/storage used per month, so what approach would use the least bandwidth?

It kind of depends on how you want to be able to manage the stylesheets. If you do them as a field or a section, you’ll have to edit them in your admin interface. If you attach them as files, you’ll have the option of editing them using a text editor and FTP (in addition to managing them with the File Manager extension). That said, managing them in Symphony creates some interesting possibilities too because you have the ability to do some processing before output…

My only advice would be that it’s probably ideal to merge the css into a single file, so your visitors only need 1 css file request per visit. If you don’t want to do that, at least be sure that you give each dynamically created css file a different name, so browser caching doesn’t get confused.

Depending on how much CSS will be unique per URL, you might also consider creating a common css file, then just loading the styles specific to each page into the <head /> directly.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details