|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
bimal Smarty Elite
Joined: 19 Apr 2007 Posts: 423
|
Posted: Fri Nov 06, 2009 9:50 am Post subject: How to purify your Smarty Template (HTML)? |
|
|
If you follow these simple ideas, you can make a good HTML template that is at least fully css based. Kick off each of these words below, in your template file, if are used as HTML tags/attributes.
- border
- font
- color
- style
- width
- height
- align
These are the basic HTML tags or attributes that are likely to be in the template file. They are often written as inline css or layout controllers. If you remove these tags/attributes from your template file (*.tpl), you are sure; you control the layout using css only. And use <link> tag to import a css file into your template.
For example:
Code: | <link href="css/ecommerce.css" rel="stylesheet" type="text/css" /> |
Plus, if you are using a visual editor, like Dreamweaver, there can be a little trouble to maintain ONE copy of css file within your template_c/css folder and main /css folder.
You can avoid this by writing a one-line code within the template/_c/*.css as:
Code: | @import url('../../css/ecommerce.css'); |
Here would be your simple directory structure:
css/ecommerce.css
template_c/css/ecommere.css (Imports main css file only, and does not have its own css body)
template_c/*.tpl (relatively uses template_c/css/*.css,which in turn use the css in production (/css/*.css)
When in the production mode, the css files within template_c/css are never utilized. They are just for your visual editors only. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|