Okay to hardcode link to stylesheet in template?

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"
Post Reply
Cerulean
Forum Members
Forum Members
Posts: 172
Joined: Mon Nov 01, 2010 8:56 am

Okay to hardcode link to stylesheet in template?

Post by Cerulean »

This might be a silly question, but what is the advantage in pasting in my CSS at Layout > Stylesheets and then calling it in the template with {cms_stylesheet}?

It seems easier to just leave the hardcoded links to the stylesheets in my template.

Will a template function okay with hardcoded stylesheet links?
uniqu3

Re: Okay to hardcode link to stylesheet in template?

Post by uniqu3 »

If you prefer to upload your stylesheet to a folder and hardcode it in the template thats fine at will work.
Downside of this is that you need to download the stylesheet each time you want to do a minor change and reupload again, with {cms_stylesheet} it is also being cached.
faglork

Re: Okay to hardcode link to stylesheet in template?

Post by faglork »

uniqu3 wrote: Downside of this is that you need to download the stylesheet each time you want to do a minor change and reupload again, with {cms_stylesheet} it is also being cached.
UPSIDE is you can work with the web developer extension for Firefox, where you can "live edit" your style sheets, and you can work much faster because you see the changes in realtime ...

Cheers,
Alex
uniqu3

Re: Okay to hardcode link to stylesheet in template?

Post by uniqu3 »

faglork wrote:
uniqu3 wrote: Downside of this is that you need to download the stylesheet each time you want to do a minor change and reupload again, with {cms_stylesheet} it is also being cached.
UPSIDE is you can work with the web developer extension for Firefox, where you can "live edit" your style sheets, and you can work much faster because you see the changes in realtime ...

Cheers,
Alex
Indeed but those 5 seconds are not worth it when I loose the smarty power in stylesheets and with this  controlls like colors, width and other options that can be used with smarty in css.
Last edited by uniqu3 on Tue Nov 02, 2010 6:32 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Okay to hardcode link to stylesheet in template?

Post by Dr.CSS »

@faglork

Firefox Web Dev. don't care where the style sheets come from it will still work with them...
faglork

Re: Okay to hardcode link to stylesheet in template?

Post by faglork »

Dr.CSS wrote: @faglork

Firefox Web Dev. don't care where the style sheets come from it will still work with them...
Of course ...

but only with an external style sheet you can just press "save", change to a tab running fireftp, load up the css file, and you are done. This is much faster than opening the stylesheet(s) in the editor and then transfering all the changes to the respective stylesheet.

Cheers,
Alex
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Okay to hardcode link to stylesheet in template?

Post by RonnyK »

Well, there is one thing... module... TemplateExternalizer...

http://dev.cmsmadesimple.org/projects/externalizer

That way you can edit realtime and store. It will be included inside the DB by the module.

Ronny
Fraserm
Forum Members
Forum Members
Posts: 107
Joined: Wed Mar 04, 2009 2:27 pm

Re: Okay to hardcode link to stylesheet in template?

Post by Fraserm »

I'm surprised nobody has yet mentioned the time it would take to update a multiple template website...

If you're using {cms_stylesheet} you can use as many stylsheets as you want, edit them easily, add more easily and you never have to go anywhere near your templates.

If you hard code them into your templates and you want to add a new stylsheet you have to go through and update every template you're using. It's an unecessary job, even if your site is only using a few.
Post Reply

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