User Tools

Site Tools


Sidebar

startup_tutorial_and_checklist:usability_configuration:seo:allow_seller_to_set_meta_title_description

Allow Seller To Set Header Elements

The flexibility of the site wide optional field feature can allow the seller to set their own header elements if you configure your site so. The first is determine what you think they should be able to set and set aside the appropriate number of site wide optional fields necessary for them. So you will need to first determine what you want them to set/control first. You could want to allow the seller to determine the html title tag contents, meta title, meta description and meta keywords. Within this article are our suggestions on how to accomplish this but the ultimate method and how much you trust your sellers to interject content into your header content is up to you.

The suggestions in this article will assume you are setting these fields up site wide and will be using one site wide page template for the listing details page. But you can get down to category by category control with the fields as well as with the page templates so think ahead and choose the configuration you need. We are also assuming you are using one field for each "tag" you want to allow them to set. You could just set one field for all meta tags and trust the seller will insert them properly. Again a choice of your own but we'll make suggestions to allow for the setting of the contents of the tags and not for the sellers complete formatting of the tags and their contents.

Configuration of Site Wide Fields

Set aside site wide optional fields for each field you wish to allow your sellers to set. Being site wide you would turn them on within the following admin tool:

LISTING SETUP > FIELDS TO USE

For this tutorial we'll set aside three to show some possibilities. We'll choose the site wide optional field 10, 11 and 12. We'll turn them on site wide in the admin tool above and set them required, editable, Text (Single Line) and a max field length in characters to 70. Below is a screenshot of what we have done:

Note that with all site wide optional fields the labels you set within the above admin tool ONLY controls display within the admin tool. The labels you set there will not display on the client so label them descriptive of what will be in them. You still need to edit the client side labels for those two fields. Within the above admin tool also click through all the "Display in…" tabs to make sure those fields are not displayed within any pages, modules, pic modules or addons.

These fields will only display within two pages on the client side. That is within the listing collection details page of the place a listing process and the edit listing details page of the edit a listing process. The content set within these fields will only display within the html head of the listing display page and no labels are necessary there. Go to these admin tool pages to label those fields:

PAGES MANAGEMENT > LISTING PROCESS > Listing Detail Collection
PAGES MANAGEMENT > USER MANAGEMENT > Users Current Listings > Edit Listings Details

We labeled the fields on the client side the same as the admin tool. You can label as you like. Once you have the above setup you'll see those fields appear in the "additional information" section of the listing details collection page of the place a listing process like this:

Placement Within Listing Details Page Template

By default the HTML head within the listing details page is within the following page template:

/main_page/listing_display.tpl

You will edit that template to insert the display of the site wide optional fields within the html head of that page. The starting html head in that template will look something like:

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>{module tag='module_title'}</title>
		<meta name="description" content="">
		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

		{head_html}
		
		<!--  This loads the RSS feed  -->
		<link rel="alternate" type="application/rss+xml" title="Newest Listing Feed" href="rss_listings.php" />
		
		{include file='head_common.tpl'}
		<script src="js/modernizr-2.6.2.min.js"></script>
		<script>Modernizr.load({ test: Modernizr.mq('only all'),nope:'{external file="css/old_ie.css"}'});</script>
	</head>

With our site wide optional fields we are replacing the title and meta description and adding the meta keywords. Note that by default at installation the title tag is managed by the title module. Within the listing details page the title module simply takes the title of the listing and places it within the title tag. So if that's fine for you we would suggest leaving that alone and just using two site wide optional fields to control meta description and meta keywords. This example replaces all three though. The above code would turn into this:

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>{$optional_field_10|strip_tags|truncate:70|escape:'all'}</title>
		<meta name="description" content="{$optional_field_11|strip_tags|truncate:130|escape:'all'}">
                <meta name="keywords" content="{$optional_field_12|strip_tags|truncate:130|escape:'all'}">
		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

		{head_html}
		
		<!--  This loads the RSS feed  -->
		<link rel="alternate" type="application/rss+xml" title="Newest Listing Feed" href="rss_listings.php" />
		
		{include file='head_common.tpl'}
		<script src="js/modernizr-2.6.2.min.js"></script>
		<script>Modernizr.load({ test: Modernizr.mq('only all'),nope:'{external file="css/old_ie.css"}'});</script>
	</head>

We saved the above and placed a test listing. We viewed the listing details page html source and found the following:

startup_tutorial_and_checklist/usability_configuration/seo/allow_seller_to_set_meta_title_description.txt · Last modified: 2014/11/19 16:42 by geojames