Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
Hi everyone!

I have a website that is based on Couch CMS and I'm planning on redesigning it. The structure and the content will stay the same, only CSS will be changed. What is the easiest way to do it if Couch is installed and if I don't want to turn on maintenance mode on the website?
If I absolutely have to do work like this on a live website, the best way I've found is to log in as super admin, and create a new css file that only shows if super admin is logged in.
So something like this in the head:
Code: Select all
<cms:if k_user_access_level = "10">
<link rel="stylesheet" href="css/redesign.css">
<cms:else />
<link rel="stylesheet" href="css/original.css">
</cms:if>

Assuming you have the header assets stripped out into a snippet, it's pretty easy to modify the whole site this way. Then once you're finished, just link to the redesigned stylesheet.
Hope that helps!
I agree with @ewanmc and suggest an alternative to quick-switch between before/after css styles: instead of linking logged status, may add a query string variable like example.local/?css=1, then check with following (logically identical to what @ewanmc suggested) code —

Code: Select all
<cms:set mycss = "<cms:gpc 'css' />" />
<cms:if mycss eq '1'>
<link rel="stylesheet" href="css/redesign.css">
<cms:else_if mycss eq '2' />
<link rel="stylesheet" href="css/redesign-variant2.css">
<cms:else />
<link rel="stylesheet" href="css/original.css">
</cms:if>


Additional query string parameter nc=1 will force CMS to load page without caching. Caching is disabled for logged-in users, including superadmin, anyway, but just in case the pages are cached and you need to check a page in browser's Incognito mode (where users are logged-off by default), adding this param disables cache for the viewed page e.g. example.local/?css=1&nc=1.
Thanks guys!

Will try both solutions and let you know how it goes :)
4 posts Page 1 of 1