Re: [SMARTY] Including CSS
| From: | (PHPDiscuss - PHP Newsgroups and mailing lists) | Date: | Fri, 18 Jun 2004 06:06:44 +0000 |
| Subject: | Re: [SMARTY] Including CSS | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11470@lists.php.net to get a copy of this message | ||
Hi,
I am facing the same problem. i.e. problem with <link href="css/main.css"
type="text/css" rel="stylesheet" />
I tried to use { Literal } and it didn't work. I tried
<style>{literal}</style> and <style> without {literal}, they work fine.
I need help... friend.
<html>
<head>
<title>add customer</title>
<link href="css/main.css" type="text/css" rel="stylesheet" />
</head>
<body>
<table><tr><td>...</td></tr></table>....
</body>
</html>
I have my href="csss/main.css" path correct for the main.css file. It's
there.
Please help. Thanks.
Sg wrote:
> Thanks all for the css answers. Using the path relative the the php page
did
> the trick.
> s.
> Michael Delorme wrote:
> > the CSS file must be relative to the PHP file and not relative to your
> > Smarty template
> >
> > |
> > |- test.php
> > |-css
> > | |_ test.css
> > |
> > |_template
> > |_ test.tpl
> >
> > test.php
> > --------
> > <?php
> > ...
> > display("test.tpl")
> > ?>
> >
> > test.tpl
> > --------
> > <html>
> > <head>
> > <link rel="stylesheet" href="/css/test.css"
> > type="text/css" media="screen"
> > title="Test" />
> > ...
> >
> > or
> >
> > <link rel="stylesheet" href="css/test.css"
> > type="text/css" media="screen"
> > title="Test" />
> >
> > and not
> >
> > <link rel="stylesheet" href="../css/test.css"
> > type="text/css"
> > media="screen" title="Test" />
> >
> > A 11:41 21/04/2004 -0500, vous avez écrit :
> > >This seems basic, but how do you include a css stylesheet
> > >in a smarty template? I have no trouble including inline styles
> > >using {literal}{/literal}, but including <link rel="stylesheet" href=
> > >"../css/style.css" type="text/css"> between the <head>
> > >tags does nothing
> > >even though
> > >it works in a regular html page [ie, not one called via
> > >$smarty->display()].
> > >I've tried putting {literal} tags around the styles in the external
> > >sheet (as well as not putting them), & importing the sheet via @ import
> > >url or
> > >including the file via {include file=""}, but nothing
> > >goes. The docs indicate this is doable:
> > >
> > >"The simplest thing is to avoid the situation altogether by separating
> > >your
> > >Javascript and CSS code into their own files and then using standard
> > >HTML methods to access them. "
> > >
> > >What am I missing? Does s/o have an example of a template that includes
> > >a stylesheet that works? Are .conf files supposed to replace
> > >css stylesheets? Thanks in advance,
> > >
> > >s.
> > >
> > >--
> > >Smarty General Mailing List (http://smarty.php.net/)
> > >To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> > _________________________________________
> > Michael Delorme
> > rue du pressoir
> > Mont July
> > 01250 Ceyzeriat
> >
> > tel/fax 04 74 47 90 20
> > mailto:michael@delorme.nom.fr
> > NTF N 46° 11' 1.24800" E 5° 19' 58.29600"
> > _________________________________________
> >
> > --
> > Smarty General Mailing List (http://smarty.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php