Keyword Album - Insert Keyword into page description?

ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Wed, 2011-08-17 18:17

I recently installed the Keyword album module and it uses one single description across all of the generated keyword album pages. This is causing a big headache with Google, in that it's counting all these pages as duplicate content. For those not familiar with Google's dupe content penalty...Google will penalize your pages if you have a large number of duplicate pages. In order to resolve this the keyword itself should be inserted into the description to make each description unique. Any ideas on how to accomplish that? Thanks for any advice!

 
eliz82

Joined: 2009-11-06
Posts: 71
Posted: Sat, 2011-10-08 08:30
 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Mon, 2011-10-17 19:02

Thanks for your reply but none of those links actually answer the question I asked. I need to know how to add the keyword to the description of a page generated by the Keyword Album plugin. This has nothing to do with kewords in regular page descriptions. Currently the plugin uses the same description across every keyword page.

 
eliz82

Joined: 2009-11-06
Posts: 71
Posted: Thu, 2011-10-20 16:39

"This has nothing to do with kewords in regular page descriptions."
actually is has much to do because the same tpl files from the theme are used to generate pages for both static and dynamic albums.

"Currently the plugin uses the same description across every keyword page."
so do you want that this type of html to apear in the page head when your are browsing items from dynamic albums ?
<meta name="description" content="item description, item keyword" />

.
_____________
my G2 site

 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Wed, 2011-11-16 20:28

Thanks for your response eliz82. I just need the keyword to be inserted into the description somehow to make each keyword album's meta description unique. For example, if the keyword for the album is "Fish" and description for all the albums is "An album of images"...then the combined description should say "Fish - An album of images". Or something to that effect. The problem is that there is no way to set a unique description for each keyword album page.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2011-11-16 22:11

in the head of your theme's theme.tpl:

    {if $theme.item.entityType == 'GalleryDynamicAlbum' && isset($theme.pageUrl.keyword)}
    <meta name="keywords" content="{$theme.pageUrl.keyword}" />
    <meta name="description" content="{$theme.pageUrl.keyword} - {$theme.item.description|markup:strip}" />
    {/if}

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
eliz82

Joined: 2009-11-06
Posts: 71
Posted: Sun, 2011-12-04 16:39

ichthyous:
i personally use {if $theme.pageUrl.view != 'core.ShowItem'} in the theme templates to detect if an album is dynamic.
the rest is easy.

.
_____________
my G2 site

 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Tue, 2011-12-20 22:44

Thanks so much for the reponses. The code you provided works great, but there's one issue. The keyword album pages now show duplicate sets of keywords and descriptions:

Quote:
{if $theme.item.entityType == 'GalleryDynamicAlbum' && isset($theme.pageUrl.keyword)}
<meta name="keywords" content="{$theme.pageUrl.keyword}" />
<meta name="description" content="{$theme.pageUrl.keyword} - {$theme.item.description|markup:strip}" />
{/if}
{/if}
<meta name="keywords" content="{$theme.item.keywords}" />
<meta name="description" content="{$theme.item.description|markup:strip|truncate:250} {if $theme.pageType == 'album'}{if $theme.currentPage > 1} - Page {$theme.currentPage}{/if}{/if}" />
<meta name="robots" content="index,follow" />
<meta name="robots" content="noodp" />
<meta http-equiv="imagetoolbar" content="no"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{/if}

Is there a way to use the one set if it's dynamic and the other set if it's a regular album or item page? Thanks again for the help!

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2011-12-21 00:16

ever hear of {else}?

like:
{if this}
show this
{else}
show that
{/if}

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2