Jump to content

PHP and templates question


apw

Recommended Posts

Hello,

 

my php website is a free link directory similar to dmoz directory.  My website uses templates to handle the content but my question is i want to add meta-tags and other content to get my website seo ready .. Is this possible with templates?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.