Jump to content

PHP and templates question


apw

Recommended Posts

I use Smarty as my template system of choice and it's quite possible (most likely the same with others too) by changing a few of the sites constants or variables.

 

I have a config file where I hold my site defaults so there I have the default page title & meta info (description, keywords, etc). Now on each page I just set the constants differently and the page takes on the new data.

 

Example.

 

 

config file

$smarty->assign('site_title', 'This is my title');
$smarty->assign('site_description', 'This is my description');
$smarty->assign('site_keywords', 'kw1, kw2, kw3');

 

contactus.php (random example)

$smarty->assign('site_title', 'Contact us');
$smarty->assign('site_description', 'Page for contacting company x');
$smarty->assign('site_keywords', 'contact, form, etc');

 

HTH

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.