Jump to content

custom.css changes gone


snake

Recommended Posts

I had put some custom css in my /templates/six/css/custom.csscustom.css file, which accoridng to the docs, should not get overwritten by updates.

However, it has been overwritten and all my changes are gone.

How, why and what can I do to stop this occurring again?

Link to comment
Share on other sites

The only way to avoid it would be to never use the default template folder since WHMCS includes a blank custom.css in it by default. Make a new theme, with a new name, in a new folder, and copy all the files to that from the default theme you're using. Once that's done, tell WHMCS to use that theme on your site.
The downside is you will need to manually edit that theme to be sure it's got the current code changes in the main theme after every update.

Link to comment
Share on other sites

8 hours ago, snake said:

I had put some custom css in my /templates/six/css/custom.csscustom.css file, which according to the docs, should not get overwritten by updates.

it does state that, but it's wrong.

https://developers.whmcs.com/themes/css-styling/

Quote

This file is included after styles.css allowing you to override any of the CSS defined within it and will not be affected by future updates to the WHMCS software.

but then you also get...

https://developers.whmcs.com/themes/getting-started/

Quote

Before you begin customising it for your needs, the first step is to create your own copy of the template. This ensures your customisations are not lost when updating.

yet it's the automatic updating of custom.css that would make the above necessary - there is literally no reason to a) have an existing custom.css file shipped with Six in the first place, and b) to subsequently overwrite it by default via the updater.

8 hours ago, snake said:

However, it has been overwritten and all my changes are gone.

if you were using the automatic updater, it should tell you that the file is about to be overwritten and to make a copy of those listed files... if updating via ftp, then it will overwrite it with it's default blank custom.css

if you want an interesting read, and a demonstration of why WHMCS is in the mess that it's currently in, take a look at the thread below about this issue last month...

8 hours ago, snake said:

How, why and what can I do to stop this occurring again?

for how & why see above - going forward, options include..

  1. keep a backup of the custom.css file - especially before updating.
  2. go down the road of duplicating the template - though if you're only customising with css and hooks, this seems a pointless step to me.
  3. use a hook to define a custom custom.css url to be used that the updater/ftp won't automatically overwrite.
Link to comment
Share on other sites

Just now, snake said:

i suggest you go read what it says in the documentation, which Brian has clearly quoted above for you.

being pedantic for a moment, but Dennis is right that it's not a bug, e.g it's doing something that WHMCS doesn't expect it to.... it's working exactly as WHMCS want it to, it's just that some of us are saying that it's silly.

however, they're not going to change this... so you'll either have to fall in line and duplicate the template, or workaround the updater by one of the above methods.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated