Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Server Side Programming > PHP Programming
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 10-20-2009, 11:40 PM
  #1
sudhakararaog
Aspirant (Level 2)
 
Join Date: Feb 2009
Posts: 13
iTrader: (0)
sudhakararaog is an unknown quantity at this point
using a css file with smarty template

in the index.tpl file which i access as http://localhost i am able to add the doctype and other tags

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$pagetitle}</title>

</head>
<body>

vale of smarty variable is {$var1}

</body>
</html>

all this works fine however when i add a link tag to call a css file as
<link rel="stylesheet" href="style.css" type="text/css" />
the code for css is
* {
margin: 0;
padding: 0;
}
body {
font: normal 12px Arial, Helvetica, sans-serif;
margin: 0;
padding: 0;
}

this css style is not being applied to the index.tpl when i access the page as http://localhost


how can i call the css file from index.tpl

also if i am using a jquery plugin i need to use a script tag to call the javascript files, how do i call these javascript file from index.tpl file


please advice.

thanks
sudhakararaog is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-21-2009, 03:37 PM
  #2
genuineskate
Paladin (Level 15)
 
Join Date: May 2006
Location: USA
Posts: 430
iTrader: (0)
genuineskate is an unknown quantity at this point
When using templates, you are not calling the location of a <link> in relation to the template directory, but in relation to the page it is parsed on.

You need to include the full path to the css just as you would from the index.php - not index.tpl.

something like...:
<link rel="stylesheet" href="templates/styles/style.css" type="text/css" />

ok?
__________________
Did i help you? Rep me!
genuineskate is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 03:08 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.