Page 1 of 2

Template and Style Sheet Replacement

Posted: Wed Feb 19, 2014 8:38 pm
by KitchM
The location of templates and style sheets has been a question of mine. After looking thru the documentation, I found little to help. But searching on the 'Net I found a reference that they are stored in a database.

If that is true, how does one replace them? (If you need a reason, how about someone damaging one and wanting to replace with an original copy.)

Thanks.

Re: Template and Style Sheet Replacement

Posted: Thu Feb 20, 2014 7:43 am
by staartmees
See in the backend under Layout > templates and stylesheets. There you can edit your templates or add a new one.

Re: Template and Style Sheet Replacement

Posted: Thu Feb 20, 2014 7:50 am
by velden
Yes they are stored into database. Like almost anything that you configure in CMSMS.

Make backups to be able to restore in case of damage.

I make backups of all my sites on a regular base. That means a file backup as well as a database backup.
You never know; a site can be hacked, deleted, user errors, a faulty module deleting data, bugs etc. etc. Just want to be on the safe side.

You could also have a look at:
http://dev.cmsmadesimple.org/projects/revisions but it's quite old and beta!

Re: Template and Style Sheet Replacement

Posted: Thu Feb 20, 2014 9:21 am
by paulbaker
http://dev.cmsmadesimple.org/projects/archiver
is great, it stores the last (say) 10 revisions of all templates, pages etc. 30 second install.

Re: Template and Style Sheet Replacement

Posted: Thu Feb 20, 2014 4:10 pm
by KitchM
Thank you everyone! That is good to confirm.

Where does one get copies of the original templates and style sheets to upload?

Re: Template and Style Sheet Replacement

Posted: Fri Feb 21, 2014 4:55 am
by frankmanl
Where does one get copies of the original templates and style sheets to upload?
Surest way might be to do a new installation and copy them from that.
In future, if you want to adjust one of the original templates (or stylesheets) you might consider to make a copy of it, rename it to mytemplate (or mystylesheet) and adjust that copy. Leave the original templates and stylesheets untill you're satisfied with your site and remove them only in last instance.

Re: Template and Style Sheet Replacement

Posted: Fri Feb 21, 2014 4:52 pm
by KitchM
I was afraid someone was going to say that. Thanks for the confirmation.

Re: Template and Style Sheet Replacement

Posted: Sat Feb 22, 2014 9:10 pm
by Rolf
KitchM wrote:Where does one get copies of the original templates and style sheets to upload?
Export the template in Theme Manager. It includes template and stylesheets. You can import it in any other cmsms site.

Re: Template and Style Sheet Replacement

Posted: Sun Feb 23, 2014 3:16 am
by KitchM
Thanks, Rolf. Excellent idea. I happen to have another installation I have not used as yet, and this may solve the problem. I just export from one and import to the other. In fact, it might be wise to make backups of the whole set of supplied components as installed.

I wonder, will this work for the ones that came with the News module?

Re: Template and Style Sheet Replacement

Posted: Tue Mar 04, 2014 9:22 pm
by Dr.CSS
News templates will have to be copy/pasted to save, no export function at this point...

Re: Template and Style Sheet Replacement

Posted: Tue Mar 04, 2014 10:40 pm
by KitchM
Do you mean that they do not come along with the others using Template Externalizer?

Re: Template and Style Sheet Replacement

Posted: Wed Mar 05, 2014 6:22 pm
by Dr.CSS
I've never used template externalizer so I have no idea, I thought you were talking about theme export...

Re: Template and Style Sheet Replacement

Posted: Wed Mar 05, 2014 7:34 pm
by KitchM
Part of my issue is that I use, like probably 90% of new users, the stock templates and style sheets out of the box. But once in a while, we botch them up by not practising good managment by making copies to use instead of the original.

Bottom line; sometimes we need to get them back. With that said, I found a method described inhttp://forum.cmsmadesimple.org/viewtopi ... =4&t=61212. Works well to get stuff out of the database.

However, as stated:
[quote][News templates will have to be copy/pasted to save, no export function at this point.../quote]

That is a bit of a catch for me. I'm not quite sure how to recover without a lot of replacement of news items.

Continued thanks.

Re: Template and Style Sheet Replacement

Posted: Thu Mar 06, 2014 4:24 am
by frankmanl
As said before
Surest way might be to do a new installation and copy them from that.
In future, if you want to adjust one of the original templates (or stylesheets) you might consider to make a copy of it, rename it to mytemplate (or mystylesheet) and adjust that copy. Leave the original templates and stylesheets untill you're satisfied with your site and remove them only in last instance.
What is the problem to do a new installation, somewhere in a newly created subfolder recovery-installation and get everything you need from there? After that - delete it!
This way you can solve your current problems and never repeat them again.
To me it seems you have been offered several solutions, but still want something else ...

Re: Template and Style Sheet Replacement

Posted: Thu Mar 06, 2014 3:28 pm
by KitchM
@frankmanl,
Sorry, I didn't mean to upset you. Please allow me to explain.

1. I was only given one option and not "several solutions". Your one suggestion had already been given.

2. Sadly, the one solution is possibly the only solution available, but that fact has not been specified as an absolute.

3. That one solution is not very handy. If is found to be truly the only one, then the code may need to be changed to make this process the same across all templates and style sheets.

I hope that clarifies things for you.