Template and Style Sheet Replacement

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
KitchM
Power Poster
Power Poster
Posts: 328
Joined: Mon Dec 02, 2013 3:26 am

Template and Style Sheet Replacement

Post 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.
staartmees
Power Poster
Power Poster
Posts: 1049
Joined: Wed Mar 19, 2008 4:54 pm

Re: Template and Style Sheet Replacement

Post by staartmees »

See in the backend under Layout > templates and stylesheets. There you can edit your templates or add a new one.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Template and Style Sheet Replacement

Post 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!
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Re: Template and Style Sheet Replacement

Post 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.
KitchM
Power Poster
Power Poster
Posts: 328
Joined: Mon Dec 02, 2013 3:26 am

Re: Template and Style Sheet Replacement

Post by KitchM »

Thank you everyone! That is good to confirm.

Where does one get copies of the original templates and style sheets to upload?
User avatar
frankmanl
Power Poster
Power Poster
Posts: 425
Joined: Sat Jul 12, 2008 3:50 am

Re: Template and Style Sheet Replacement

Post 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.
KitchM
Power Poster
Power Poster
Posts: 328
Joined: Mon Dec 02, 2013 3:26 am

Re: Template and Style Sheet Replacement

Post by KitchM »

I was afraid someone was going to say that. Thanks for the confirmation.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Template and Style Sheet Replacement

Post 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.
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
KitchM
Power Poster
Power Poster
Posts: 328
Joined: Mon Dec 02, 2013 3:26 am

Re: Template and Style Sheet Replacement

Post 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?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Template and Style Sheet Replacement

Post by Dr.CSS »

News templates will have to be copy/pasted to save, no export function at this point...
KitchM
Power Poster
Power Poster
Posts: 328
Joined: Mon Dec 02, 2013 3:26 am

Re: Template and Style Sheet Replacement

Post by KitchM »

Do you mean that they do not come along with the others using Template Externalizer?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Template and Style Sheet Replacement

Post by Dr.CSS »

I've never used template externalizer so I have no idea, I thought you were talking about theme export...
KitchM
Power Poster
Power Poster
Posts: 328
Joined: Mon Dec 02, 2013 3:26 am

Re: Template and Style Sheet Replacement

Post 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.
User avatar
frankmanl
Power Poster
Power Poster
Posts: 425
Joined: Sat Jul 12, 2008 3:50 am

Re: Template and Style Sheet Replacement

Post 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 ...
KitchM
Power Poster
Power Poster
Posts: 328
Joined: Mon Dec 02, 2013 3:26 am

Re: Template and Style Sheet Replacement

Post 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.
Post Reply

Return to “Layout and Design (CSS & HTML)”