Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Fighting with CSS for {included} files under a subdirectory?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks
View previous topic :: View next topic  
Author Message
bimal
Smarty Elite


Joined: 19 Apr 2007
Posts: 423

PostPosted: Wed Feb 08, 2012 6:06 pm    Post subject: Fighting with CSS for {included} files under a subdirectory? Reply with quote

When you have the included files under a subdirectory when the parent has access to css files, you may experience with no-css at the child file when you are editing via the GUI editor in design preview, like Dreamweaver.

Code:
<link href="css/gallery.css" rel="stylesheet" type="text/css">
<!--{*--><link href="../css/gallery.css" rel="stylesheet" type="text/css"><!--*}-->


Take a look at above code snippet of accessing the css file.
The first line is valid only during the live run.
Second like will fake the design-preview editor. But this script will not appear in the live preview.

At the run time, it only leaves <!-- and --> while the others will become Smarty comment and hide. Thus, only the first line appears, with valid css for the live preview.

But for the design-editor, both the lines are valid. And first one does not give any impact to the editor. Second one, though within double comments of html and smarty, the link to css is still valid, and your design appears correctly in the design-preview mode.

Happy CSSing even in the included files.
parent: {include file='includes/gallery.tpl},
child (gallery.tpl):
Code:
<link href="css/gallery.css" rel="stylesheet" type="text/css">
<!--{*--><link href="../css/gallery.css" rel="stylesheet" type="text/css"><!--*}-->


Hope this helps everyone Smile
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP