Re: [PHP] question about smarty

2009-11-05 Thread Fernando Castillo Aparicio
I'm not sure where is the problem, but can't you just define every changing 
part in your template as variables and assign them as needed from php?

If you need to change the image url, just make it a variable, like in

background:url(images/{$img})

Then you just assign the variable as needed in each file:

//template1.php
$img = 'mi_image_1.gif';
$smarty->assign( 'img', $img );

//template2.php
$img = 'mi_image_2.gif';
$smarty->assign( 'img', $img );

That way you don't need to use the {if} inside smarty and make your template 
lighter.





De: Sudhakar 
Para: php-general@lists.php.net
Enviado: vie,6 noviembre, 2009 00:14
Asunto: [PHP] 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}

{else}

{/if}


so i need to chane 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.



  

Re: [PHP] question about smarty

2003-03-04 Thread Sunfire
sigh well im sort of crashed my web server right now because maguma decided
to mess up a few things with extensions and now dont know how to fix it..

but once i get that fixed i guess i can try smarty and see how that goes..


- Original Message -
From: "rush" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 04, 2003 9:35 AM
Subject: Re: [PHP] question about smarty


> "Sunfire" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > k then that wont be able to be a choice for me then... will try maguma
> > studio then..
>
> I think you have misunderstood the posting, since Smarty can be used in
most
> web hosting environments. Anyway if you would like to evaluate other
> options, you can also give a shot to the TemplateTamer.
>
> rush
> --
> http://www.templatetamer.com/
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] question about smarty

2003-03-04 Thread rush
"Sunfire" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> k then that wont be able to be a choice for me then... will try maguma
> studio then..

I think you have misunderstood the posting, since Smarty can be used in most
web hosting environments. Anyway if you would like to evaluate other
options, you can also give a shot to the TemplateTamer.

rush
--
http://www.templatetamer.com/




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] question about smarty

2003-03-04 Thread Sunfire
k then that wont be able to be a choice for me then... will try maguma
studio then..


- Original Message -
From: "Rich Gray" <[EMAIL PROTECTED]>
To: "Sunfire" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, March 04, 2003 5:58 AM
Subject: RE: [PHP] question about smarty


> > just wondering... does smarty have to be installed on the server where
the
> > web site or php scripts it makes are going to be ran... or do you
> > just make
> > the stuff and put on the server like normal php files...
>
> No, the Smarty classes and plugins will have to be installed/accessible on
> the target server. It can be outside the document root though if it
bothers
> you...
>
> HTH
> Rich
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] question about smarty

2003-03-04 Thread Rich Gray
> just wondering... does smarty have to be installed on the server where the
> web site or php scripts it makes are going to be ran... or do you
> just make
> the stuff and put on the server like normal php files...

No, the Smarty classes and plugins will have to be installed/accessible on
the target server. It can be outside the document root though if it bothers
you...

HTH
Rich


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php