G2-Sites.com - Your FREE Gallery Directory
G2-Sites.com is a showcase of Gallery 1 and Gallery 2 powered websites. Sites are categorized by embedded environment and language. If your site is powered by Gallery we want to see it!
How to implement meta keywords and meta description
Hello,
I am wondering how to implement meta keywords and meta descriptions (i.e. for the search engine crawlers and spiders).
I have them working on another G2 site (using a mod of Matrix). But I am having trouble figuring out how to get it to work with my mod of NZDI.
NZDI has a keywords field but I gather it is for creating dynamic gallery views of images that share a keyword or set of keywords.
What I want is the keyword and description field to show up as metatags in the page header. I would also like the option of making titles and descriptions visible or not in the album and individual photo views.
But the only switch I can find in the NZDI edit mode is for summaries and that turns title, description, and dynamic keywords on all at once. (I'd actually like to turn off the dynamic gallery/keyword mechanism completely.)
Any suggestions would be appreciated.
--Doug
SalemKayaker

Doug,
I will have a think about this and get back to you in the next few days.
Great Ideas for SEO.
I will need to investigate the best way to implement the keywords and descriptions as metadata.
Thanks for looking into the metatag capability.
You may want to look at the Matrix theme.
I have keyword and description metags being generated in my mod of Matrix. The metatag generation must be implemented in that(I sure didn't do it! ;)
I am still confused as to where the boundary lies between what is implemented by a theme and what is inherent to any implementation of G2.
Anyway, if you can figure out how to add the metatag capability that would be much appreciated.
Also, in the meantime, can you suggest a way for me to individually enable/disable display of title, summary, description, and dynamic keywords in NZDI at different levels (i.e. album view and individual photo view)?
Thanks again,
--Doug
SalemKayaker
The easiest way to turn of the dynamic and keyword albums is to disable both the Dynamic Albums and Keyword Albums Plugins from the Plugins Admin interface screen.
The control of the display of the titles and summaries in the Album views is controlled by the following code from the album.tpl file:
{if !empty($child.title) && ($child.canContainChildren || $theme.params.showSummaries)}
<div class="giTitle">
{$child.title|markup}
</div>
{/if}
{if !empty($child.summary) && $theme.params.showSummaries}
<p class="giDescription">
{$child.summary|markup|entitytruncate:256}
</p>
{/if}
As you have correctly pointed both the display of Titles and the summaries (for items) are turned off and on together with the Show summary data with thumbnails theme option. This option only controls the display of summary data for sub-albums as titles are always shown for sub-albums if you have set one.
The $theme.params.showSummaries above is the variable that is set when you enable the
Show summary data with thumbnails theme option. It is defined in the theme.inc file.
If you wanted to modify this default behaviour you would need to change the code in the album.tpl file or, if you wanted to extend it to the admin interface you would need to create an additional option and seperate the control of titles and summaries. This, is not something that I currently plan to do.
As far as the Album and Item descriptions are concerned they are set from the almum.tpl and photo.tpl files respectively. If you wanted to remove or modify you would need to look for the following in the album.tpl file:
{* Start - Album Description *}{if !empty($theme.item.description)}
<div id="photo-info">
<div class="gallery-content">
<div class="giDescription gcBackground2">
{$theme.item.description|markup}
{if isset($theme.pageUrl.keyword)}
{g->text text=" - "} <span class="keyword">{$theme.pageUrl.keyword}</span>
{/if}
</div>
</div>
</div>
{/if}
{* End - Album Description *}
or the following in the photo.tpl file:
{* Item Description *}{if !empty($theme.item.description)}
<div id="photo-info">
<div class="gallery-content">
<div class="giDescription gcBackground2">
{$theme.item.description|markup}
</div>
</div>
</div>
{/if}
You would then modify to suit your requirements.
Before you start making changes to theme templates you may want to take a look at the following information: http://codex.gallery2.org/Gallery2:Editing_Templates
I hope this helps.
There is a new version of the theme.tpl file that adds the album/item descriptions as the html meta description. It can be found at the NZDI SVN repository.
This does not work in embedded Drupal implementations. I suspect it may not work in embedded mode at all - not fully tested in an embedded environment
This should help with the search engine results descriptions.
I was successful in apply the new theme.tpl and I now have meta-descriptions based on the album or item descriptions.
Are you thinking of implementing meta keywords too? (Hey, give me an inch and I will take a mile). ;)
Thanks!
Doug
SalemKayaker
Doug,
At this stage I don't have the time to work on this. So, in the short term I probably won't be looking at this.
I may address it again in the future. I would have to question the relevance of keywords in html metatdata.
At this stage a low priority.