Support Forums

Smarty In CSS

This is a discussion on Smarty In CSS within the Templates, HTML, CSS, and Design Help forums, part of the General category; Hi, With my new template on the homepage i dont want to display Code: background:url(images/header-bg.png) no-repeat; in my css. Is ...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 06-01-2009, 08:46 AM   #1
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 1,073
Rep Power: 32
bowers01 is on a distinguished road
Default Smarty In CSS

Hi,
With my new template on the homepage i dont want to display
Code:
background:url(images/header-bg.png) no-repeat;
in my css. Is there a way to not display it?
Is there something like {if $body=!'home.tpl'} that can be used in css?
I dont really want to have to make different css sheets for different pages.
Cheers,
Nick
__________________
Nick Bowers
68c v4.1.10 Developer Custom Template
bowers01 is offline   Reply With Quote
Old 06-01-2009, 10:12 AM   #2
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,493
Rep Power: 132
Eric Barnes is just really nice Eric Barnes is just really nice
Default

Just assign that style to the body tag. Something like:
<body{if $body=='home.tpl'} class="home"{/if}>
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 06-01-2009, 11:10 AM   #3
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 1,073
Rep Power: 32
bowers01 is on a distinguished road
Default

Hi,
Thanks for the reply, i never though to do it that way because the code looks like this
Code:
#wrapper{
	width:1000px;
	margin:0 auto;
}
	#header{
		height:105px;
		background:url(images/header-bg.png) no-repeat;
	}
		#logo{
			width:371px;
			padding:41px 0 0 15px;
		}
			#logo h1{
				background:url(images/logo.png) no-repeat;
			}
				#logo h1 a{
					display:block;
					height:27px;
				}
					#logo h1 a span{
						display:none;
					}
i just tried adding
Code:
		#header2{
		height:105px;
	}
under #header and in the layout.tpl changed it to {if $body=='home.tpl'}<div id="header2">{else}<div id="header">{/if} but it doesnt load any header.
Any idea?
Cheers
__________________
Nick Bowers
68c v4.1.10 Developer Custom Template
bowers01 is offline   Reply With Quote
Old 06-01-2009, 11:15 AM   #4
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,493
Rep Power: 132
Eric Barnes is just really nice Eric Barnes is just really nice
Default

Can you view source and see if it is actually changing the id on the div?
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Smarty help island1 Templates, HTML, CSS, and Design Help 2 01-09-2009 05:19 PM
Smarty functions seymourjames Modules / Plugins / Modifications 10 08-20-2008 07:54 AM
A bit of XHTML and Smarty seymourjames Modules / Plugins / Modifications 6 08-11-2008 04:44 PM
I need a hand on smarty please... canariasdata Technical Support 32 06-14-2008 06:26 AM


All times are GMT -4. The time now is 06:23 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0