ArticleMS

How to add Meta Tags to Your AMS Web Site

These additions to the AMS templates will let you define a default Meta Description and Keyword tags as well as using the article keywords and summary to populate the meta tags for your article pages.

1. Add this code into the Html section of your Header Template between the <head></head> tags (this inserts the description and keywords into the tags) :

<meta name="description" content="{$metatagd}" />
<meta name="keywords" content="{$metatagk}" />

2. Add this code into the Php section of your Header Template (this defines the default description and keywords for the home page and all other pages not modified by the codes 3 and 4 below):

$metatagd = '';
if (isset ($this->meta_description) && !empty ($this->meta_description)) {
$metatagd = $this->meta_description;
}
else{
$metatagd = 'Place Your Description Here';
}

$metatagk = '';
if (isset ($this->meta_keywords) && !empty ($this->meta_keywords)) {
$metatagk = $this->meta_keywords;
}
else{
$metatagk = 'Your, Keywords, Go, Here';
}

3. Place this code into Php section of the Article Template (this calls the article summary and keywords that are placed into the meta tags):

$this->meta_description = substr (strip_tags ($Article->summary), 0, 180);
$this->meta_keywords = $Article->keywords;

4. If you want to add meta tags into your StandAlone and Pages templates add this code into their Php section:

$this->meta_description = 'Place Your Description Here';
$this->meta_keywords = 'Your, Keywords, Go, Here';