PDA

View Full Version : SE2. Adding META tags: keywords, description, etc.


Shopengine support
22-01-2010, 18:52
About adding META tags to your ShopEngine2 shops

go to se2_root_directory/themes/your_theme/data/header.tpl
there is some code within <head>...</head> tags, such as <title>...</title> tag, etc.
according to http://www.w3schools.com/html/html_meta.asp meta tags look like these:

<meta name="description" content="your meta description" />
<meta name="keywords" content="your meta keywords" />

using SE2 functions you can define custom descriptions/keywords for different pages
it looks like this:

<meta name="description" content="{:if $current_page == "index" || $current_page == "":}
meta description for main index page
{:elseif $current_page == "all_products":}
meta description for "all_products" page
{:elseif $current_page == "bestsellers":}
meta description for bestsellers
{:elseif $current_page == "cart":}
meta description for cart
{:elseif $current_page == "contacts":}
meta description for contacts page
{:elseif $current_page == "faq":}
meta description for FAQ page
{:elseif $current_page == "group":}
meta description for pages where group of products is displayed (ED, Antibiotics, etc)
{:elseif $current_page == "item":}
meta description for a current product page
{:elseif $current_page == "moneyback_policy":}
.... etc
{:else:}
default meta description for all other pages not mentioned above
{:/if:}" />

you should add the code written above within <head>...</head> tags in se2_root_directory/themes/your_theme/data/header.tpl in order to implement custom meta description.

Example:
let's add "Erectile Dysfunction Products at Online Pharmacy"-like description for "group" pages and
"Cheap Viagra for only $1.88 per pill"-like for "item" pages

<meta name="description" content="{:if $current_page == "index" || $current_page == "":}
Online pharmacy
{:elseif $current_page == "cart":}
Your cart
{:elseif $current_page == "group":}
{:se_module module="item" action="group_data" group_id="auto" var_name="b_group":}
{:$b_group.name:} Products at Online Pharmacy
{:elseif $current_page == "item":}
{:se_module module="item" action="item_data_by_ids" item_ids=$smarty.get.id type="small" fields="name,price_per_item" var_name="title_data":}
Cheap {:$title_data.name:} only ${:$title_data.price_per_item:} per pill
{:else:}
Online pharmacy
{:/if:}" />

Example for keywords:
"erectile dysfunction viagra cialis levitra ..."-like for group pages (group name and all products in this group)
"cheap viagra erectile dysfunction online"-like for products

<meta name="keywords" content="{:if $current_page == "index" || $current_page == "":}
pharmacy viagra cialis cheap
{:elseif $current_page == "cart":}
your cart
{:elseif $current_page == "group":}
{:se_module module="item" action="group_data" group_id="auto" var_name="b_group":}
{:$b_group.name|lower:} {:foreach name=items key=key item=item from=$b_group.items:}{:$item.name|lower:} {:/foreach:}
{:elseif $current_page == "item":}
{:se_module module="item" action="item_data" item_id=$smarty.get.id var_name="title_data":}
cheap {:$title_data.name|lower:} {:$title_data.group.name|lower:} online
{:else:}
online pharmacy
{:/if:}" />