Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
using a css file with smarty template
Old 10-21-2009, 12:39 AM using a css file with smarty template
Ultra Talker

Posts: 254
Trades: 0
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
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-21-2009, 09:21 AM Re: using a css file with smarty template
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,516
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Open the page source when rendered in the browser and make sure the sylesheet element is in the head and is correctly formed
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-21-2009, 05:55 PM Re: using a css file with smarty template
Ultra Talker

Posts: 254
Trades: 0
thanks a lot

i viewed the source and changed the path of css file to templates/template1/style1.css

and the browser interprets http://localhost:81 by default so in the link tag
i have given

<link rel="stylesheet" href="templates/template1/style1.css" type="text/css" />

instead of
<link rel="stylesheet" href="http://localhost:81/templates/template1/style1.css" type="text/css" />


thanks
sudhakararaog is offline
Reply With Quote
View Public Profile
 
Old 10-21-2009, 06:03 PM Re: using a css file with smarty template
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,516
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
use root relative addressing by adding a "/" in front of the file path.
The browser will the normalise automatically (the source will still say "/templates/ ...") but the browser will know exactly where the file is on the server.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-21-2009, 06:07 PM Re: using a css file with smarty template
Ultra Talker

Posts: 254
Trades: 0
thanks
sudhakararaog is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to using a css file with smarty template
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.43677 seconds with 12 queries