Php Link Directory - Changing Page Title Order

|
PhpLinkDirectory is a PHP/MySQL link directory that offers SEO friendly URLs. Instead of appending crazy queries to the URLs (eg. index.php?cat=4545) you can have semantic and keyword rich directory paths. The full source code is available for you to peruse and, if you are up to it, improve on. One of the system's weaknesses is that you have very little control over page titles "out of the box" ie. you cannot specify the order in which elements appear (some other systems do allow you easy access to this). By default the page title tags appear as: Site Name - Sub-Category Level 1 - Sub-Category Level 2 So if you had a site called say "Seo Directory" and a category "Google" you'd end up with: Seo Directory - Google Which isn't too bad until you start adding more sub-categories: Seo Directory - Google - Adwords The theme or topic of the subcategory should be given more prominence and the site title, which is a global, needs to be pushed to the end of the line. As I like to be able to rejig the title order so that I get: Category - Site Name The way to do it involves editing two files: main.tpl header.tpl In main.tpl find the following section of code: {capture name="title"} {if count($path) > 1} - {/if} {foreach from=$path item=category name=path} {if $smarty.foreach.path.iteration gt 2} > {/if} {if not $smarty.foreach.path.first} {$category.TITLE} {/if} {/foreach} {/capture} This needs to be replaced with: {capture name="title"} {section loop=$path name=foo step=-1} {$path[foo].TITLE} {if !$smarty.section.foo.last} > {/if} {/section} {/capture} You then need to make one minor change to header.tpl: {if empty ($TITLE)} {$smarty.const.DIRECTORY_TITLE|escape|trim} {/if} {$smarty.capture.title|strip|trim} Replace that with: {$smarty.capture.title|strip|trim} Taken from the PhpLinkDirectory forum

Categories

,

About this Entry

This page contains a single entry by Michele Neylon published on January 7, 2007 11:59 AM.

Search Terms Reflect User Base? was the previous entry in this blog.

Adding Firestats To PhpLinkDirectory is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.1