AW: Extra stylesheets for different pages
| From: | Werner Schweizer | Date: | Sat, 22 Dec 2001 14:54:53 +0000 |
| Subject: | AW: Extra stylesheets for different pages | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2373@lists.php.net to get a copy of this message | ||
I'm passing variables to the {include ...} statement.
Below you can find my "header.tpli" which is included by:
{include file="header.tpli" kind="main"}
------------------------------------------
<html>
<!-- This page was dynamicaly created by a PHP script -->
<!-- using the template engine Smatry 1.4.6 -->
<!-- Copyright C 2001 Werner Schweizer -->
<head>
{include file="meta".$kind.".tpli" meta="main"}
{if $script == "frameset"}
<script src="scripts/GoTop.js" type="text/javascript"></script>
{else}
<script src="scripts/Navigation.js" type="text/javascript"></script>
{/if}
{if $kind == "frame"}
<base target="Mainframe">
{else}
<base target="_self">
{/if}
<link rel="stylesheet" type="text/css"
href="{$RootUrl}/styles/base.css">
<link rel="stylesheet" type="text/css"
href="{$RootUrl}/styles/{$kind}.css">
{assign var="cFile" value=$cFile|default:main}
{assign var="cNumber" value=$cNumber|default:1}
{assign var="title" value=$title|default:"unbenannt"}
<title>{$title}</title>
</head>
------------------------------------------
> -----Ursprungliche Nachricht-----
> Von: Peter Bowyer [mailto:reywob@f2s.com]
> Gesendet: Samstag, 22. Dezember 2001 09:57
> An: smarty@lists.ispi.net
> Betreff: [smarty] Extra stylesheets for different pages
>
>
> Hi,
>
> How do other people handle having extra stylesheets/javascript for
> different parts of their site while using Smarty? The only way I
> can think
> of is either to make separate header files, which I don't want to
> do, or to
> create a custom function such as:
> {header type=stylesheet link=article.css}
> {header type=javascript link=script.js)
> and put this in my page templates. The function is then processed, and
> assigns anything it generates to a {$header} variable in the header file.
>
> I'm just worried that this is more overhead, which may be avoidable?
>
> TIA,
> Peter.
>
> --oOo--
> Narrow Gauge on the web - photos, directory and forums!
> http://www.narrow-gauge.co.uk
> --oOo--
> Peter's web page - Scottish narrow gauge in 009
> http://members.aol.com/reywob/
> --oOo--
>
>
> ---
> You are currently subscribed to smarty as: W.Schweizer@SwissOnline.ch
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
>