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

Great Ideas!

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.

metatags for SEO and individual enable/disable of title etc.

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

Turn Off Dynamic and Keyword Albums

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

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.

Gallery descriptions now HTML meta descriptions

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.

Thanks, I successfully applied the new theme.tpl

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

At this stage no!

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.

Indeed a great idea, Doug.

Indeed a great idea, Doug. G2-sites, can you come back and post the methods you find so we can all learn a little bit from you?
_____________
California Orange County SEO

Anoop Srivastava

It is not very hard and fast rule for to create meta title and description..But you have to make a unique for all pages. you have to decide a your services and product and according to this you have to make it.

Thanks
http://anoop-asp.blogspot.com/

Good articles

Hello everyone. Interesting idea for a blog. I have been checking out many blogs and forums recently. Some are really informative some are entertaining and some are a real crack up. I've got to admit factoring receivables, great job on this blog, I'll be sure to look in from time to time.