PDA

View Full Version : Change Meta Title for category and subcategory


lebefa
05-29-2006, 12:50 PM
in 3.0.5

Is there a way to change the meta title for category and subcategory pages to be displayed this way :

category - name of the directory
subcategory > category - name of the directory

instead of

name of the directory - category
name of the directory - category > subcategory


Other question I would like to add the name of my city just after the category name or just after the subcategory name to be shown only for the page title.
i.e. Restaurants New York - Name_of_my_directory
Chinese food New York > Restaurants - Name_of_my_directory

Would be the perfect titles for my directory...

Thanks for your help

bobby9101
05-29-2006, 08:13 PM
post your header.tpl please

lebefa
05-29-2006, 09:41 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
{* Document/Browser title *}
<title>{if empty ($TITLE)}{$smarty.const.DIRECTORY_TITLE|escape|tri m}{/if}{$smarty.capture.title|strip|trim}</title>

{* Document character set *}
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

{* CSS Style file *}
<link rel="stylesheet" type="text/css" href="{$smarty.const.FULL_TEMPLATE_PATH}/style/style.css" />

{* Custom META tags *}
{if $smarty.const.ENABLE_META_TAGS}
{if !empty($MetaKeywords)}
<meta http-equiv="keywords" content="{$MetaKeywords|strip|escape|trim}" />
{/if}
{if !empty($MetaDescription)}
<meta name="description" content="{$MetaDescription|strip|escape|trim}" />
{/if}
{if !empty($MetaAuthor)}
<meta name="author" content="{$MetaAuthor|strip|escape|trim}" />
{/if}
{if !empty($MetaCopyright)}
<meta name="copyright" content="{$MetaCopyright|strip|escape|trim}" />
{/if}
{if !empty($MetaRobots)}
<meta name="robots" content="{$MetaRobots|strip|escape|trim}" />
{/if}
{/if}

{* Please keep this line for better version tracking *}
<meta name="generator" content="PHP Link Directory {$smarty.const.CURRENT_VERSION}" />

{* Live Bookmarks *}
{if $smarty.const.ENABLE_RSS and (!empty($search) or $category.ID gt 0 or $list) and count($links) gt 0}
<link rel="alternate" type="application/rss+xml" title="{$in_page_title|escape|trim}" href="{$smarty.const.SITE_URL}rss.php?{if !empty($search)}search={$search|@urlencode}{elseif $p}p={$p}{elseif $list}list={$list}{else}c={$category.ID}{/if}" />
{/if}

{* JavaScript libraries *}
{* SmartyFormtool for manipulating forms with JavaScript *}
{formtool_init src="javascripts/formtool/formtool.js"}
{* OverLIB library for popups and tooltips *}
<script type="text/javascript" language="javascript" src="javascripts/overlib/overlib.js"></script>
</head>
<body>
{* This is important for the OverLIB library! *}
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>

{* Error and confirmation messages *}
{include file="../$core_templates/messages.tpl"}

<table width="100%" border="0" cellspacing="4" cellpadding="4">
<tbody>
<tr>
<td width="40%" height="70" valign="bottom">
<a href="{$smarty.const.DOC_ROOT}/"><img src="{$smarty.const.FULL_TEMPLATE_PATH}/images/logo.gif" alt="Logo" width="224" height="43" border="0" /></a>
</td>
<td valign="bottom">
<div align="right" class="user_menu">
{if $smarty.const.REQUIRE_REGISTERED_USER == 1}
{if empty ($regular_user_details)}
<a href="{$smarty.const.DOC_ROOT}/login.php" title="{l}Log In to your account{/l}">{l}Login{/l}</a> | <a href="{$smarty.const.DOC_ROOT}/profile.php?mode=register" title="{l}Register new user{/l}">{l}Register{/l}</a>
{else}
{l}Welcome:{/l} <strong>{$regular_user_details.NAME|escape}</strong> [ <a href="{$smarty.const.DOC_ROOT}/logout.php" title="{l}Log out of this account{/l}">{l}Sign Out{/l}</a> ] {/if}
{/if}
</div>
</td>
</tr>
</tbody>
</table>

bobby9101
05-29-2006, 09:44 PM
what template and what version?
I am unfamiliar with 3.0.5 or any of the 3+s really.
I usually hvae a general idea though
However Meta.Description is a variable that is exclusive 3+ and i am unsure where it is defined. you will need to chnage it there

lilboggle
05-30-2006, 01:21 AM
Just change the code from this:
<title>{if empty ($TITLE)}{$smarty.const.DIRECTORY_TITLE|escape|tri m}{/if}{$smarty.capture.title|strip|trim}</title>
To THIS:
<title>{if empty ($TITLE)}{$smarty.capture.title|strip|trim}{/if}{$smarty.const.DIRECTORY_TITLE|escape|trim}</title>

Althought it wont put the sub catagory head of the catagory

lebefa
05-30-2006, 09:46 AM
ok thanks lilboggle, I'll try this way.
Why won't you put the subcategory first ?
Don't you think it would be more relevant to search engines ?

Thanks.

munt
05-31-2006, 12:06 AM
hey dudes
is ther a code to display the meta description added for each category in admin in the meta tags of each page?

bobby9101
05-31-2006, 02:20 AM
{$description}

lebefa
05-31-2006, 04:53 PM
the code was ok : <title>{if empty ($TITLE)}{$smarty.capture.title|strip|trim}{/if}{$smarty.const.DIRECTORY_TITLE|escape|trim}</title>

but then the title for the detail page is not working anymore...
It only display the title of the directory

munt
05-31-2006, 10:17 PM
heres my header.tpl
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
{* Document/Browser title *}
<title>{if empty ($TITLE)}{$smarty.const.DIRECTORY_TITLE|escape|tri m}{/if}{$smarty.capture.title|strip|trim}</title>
{* Document character set *}
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
{* CSS Style file *}
<link rel="stylesheet" type="text/css" href="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/style/main.css" />
{* Custom META tags *}
{if $smarty.const.ENABLE_META_TAGS}
{if !empty($MetaKeywords)}
<meta http-equiv="keywords" content="{$MetaKeywords|strip|escape|trim}" />
{/if}
{if !empty($MetaDescription)}
<meta name="description" content="{$MetaDescription|strip|escape|trim}" />
{/if}
{if !empty($MetaAuthor)}
<meta name="author" content="{$MetaAuthor|strip|escape|trim}" />
{/if}
{if !empty($MetaCopyright)}
<meta name="copyright" content="{$MetaCopyright|strip|escape|trim}" />
{/if}
{if !empty($MetaRobots)}
<meta name="robots" content="{$MetaRobots|strip|escape|trim}" />
{/if}
{/if}


it shows the same desc for each category still

anon
05-31-2006, 10:20 PM
somebody summarize this thread into a SINGLE post, and then provide a link to your directory.

lilboggle
06-02-2006, 01:42 AM
Hey Munt

If your running version 3.05
you just enter the meta tags as you create the catagories in admin
You can also edit the catagories and add them if you didnt at first!

munt
06-02-2006, 10:42 PM
Content visible to registered users only.


thats what i did!
added great descriptive metatags when adding the categories
but doesnt seem to be showing.. only shows the default tags