Forum

Thread tagged as: Question, Problem, Addons

Perch editing CSS file

is there anyway we can use perch cms to edit a css file? for instance changing a background image?

Ashley Murray

Ashley Murray 0 points

  • 3 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

You would need to make the file editable by PHP, however you can edit any sort of text format.

That said, I'd probably just have the background image as an inline style rule and change it there in the template.

that's what I have done in the meantime, I was just thinking that if the user wanted to change a background image a simple click to change an image file is simple enough as this is how the site was built, otherwise I have to build certain section again that was all, thanks for the help

Drew McLellan

Drew McLellan 2638 points
Perch Support

I'd be tempted to use either an inline style or a <style> block in the page.

If you make the entire CSS file editable just for a few changes, you'll invalidate any cached version of the CSS every time the editor makes a change. When the vast majority of the file is staying the same, it's better to move those editable sections out of that main CSS file.