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 11-05-2009, 06:21 PM
  #1
sudhakararaog
Aspirant (Level 2)
 
Join Date: Feb 2009
Posts: 13
iTrader: (0)
sudhakararaog is an unknown quantity at this point
question about smarty

i am using smarty template engine at work place, following is the situation

i already have 1 template that has already been created example = http://localhost/sites/template1.com this works fine

following is the folder structure i have for smarty on xampp

1. C:\xampp\htdocs\sites\template1.com where i have .htaccess index.php and siteconf.php

2. C:\xampp\htdocs\sites\_templates\templates\template1


in the siteconf.php file there are all the major variables defined which are accessed in other tpl file of the templates example in aboutus page, contactus page etc of this template1

now i have created another template called template2 and this also has the same structure

1. C:\xampp\htdocs\sites\template2.com where i have .htaccess index.php and siteconf.php

2. C:\xampp\htdocs\sites\_templates\templates\template2


my question is the look and feel when i access
http://localhost/sites/template1.com and
http://localhost/sites/template2.com

is the same the only thing that needs to be done is for template2 when i access http://localhost/sites/template2.com ONLY the header image should be different compared to the header i have for http://localhost/sites/template1.com this is the only change i need

i am not aware as to the php code i need to write so that when i access http://localhost/sites/template2.com the header image changes and this new header image remains for the entire pages of http://localhost/sites/template2.com

presently in header.tpl of template1 is written as follows

{if strpos($Data.KEYWORD,"rv rental") === false}
<div class="header" style="background:url(images/header_{$siteData.COUNTRY3}.gif) no-repeat top left;">
{else}
<div class="header" style="background:url(images/header_{$siteData.COUNTRY3}_rv.gif) no-repeat top left;">
{/if}
</div>

so i need to change the {if} {else} where i need to mention that if i am accessing http://localhost/sites/template2.com then the header image should be different.

any help will be greatly appreciated.

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 11-06-2009, 09:16 AM
  #2
scoutt
Mister Admin to you
 
scoutt's Avatar
 
Join Date: Jul 2001
Posts: 30,730
iTrader: (0)
scoutt is a jewel in the roughscoutt is a jewel in the roughscoutt is a jewel in the rough
something like this

PHP Code:
{if strpos($Data.KEYWORD,"template2.com") === false}
<
div class="header" style="background:url(images/header_{$siteData.COUNTRY3}.gif) no-repeat top left;">
{else}
<
div class="header" style="background:url(images/header_{$siteData.COUNTRY3}_rv.gif) no-repeat top left;">
{/if} 
but I don't know what $Data.KEYWORD is in smarty, I don't use it.
__________________
Have a Script or Snippet you want to share?

WWW Standards: HTML 4.01, CSS2.1, CSS3, XHTML 1.0
PHP Standards: PHP Standards
scoutt 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 04:36 PM.

   

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.