Thirteen Ways To Add SEO To Gallery2

skunker

Joined: 2005-02-04
Posts: 344
Posted: Sun, 2008-04-27 17:10

How do you edit CLASS files? Dreamweaver won't open that file.

 
ultravista

Joined: 2006-10-08
Posts: 121
Posted: Mon, 2008-04-28 12:53

notepad or other text editor. I use UltraEdit.

 
pavel.pola

Joined: 2007-05-19
Posts: 30
Posted: Thu, 2008-05-22 19:54

Hi all, thank you very much for this post!!! I have one question - I'm using carbon theme and I can't get rid off "highlightId" links in breadcrumbs. Could you please tell me, what to change to avoid it? I have changed GalleryTheme.class but it didn't help.

 
pavel.pola

Joined: 2007-05-19
Posts: 30
Posted: Thu, 2008-05-22 20:18

Sorry, my fault, everything seems to be ok, the problem was in my local cache...

 
pavel.pola

Joined: 2007-05-19
Posts: 30
Posted: Wed, 2008-05-28 10:01

I've noticed that removing highlightId from breadcrumbs may be useful for crawlers and bots, but it's completely useles for human browsing (users don't return to the page they were visiting before entering albums, etc.)

So I've returned it back to the original state.
_________________________________
Please visit my personal gallery: http://www.pavelpola.cz (mostly B&W pictures, Prague, nature, people)

 
maravizzo
maravizzo's picture

Joined: 2005-09-11
Posts: 49
Posted: Wed, 2008-07-02 10:10

Solved problem: Cannot login after update

For the people that, like me, are implementing these techniques to get a better SEO in Gallery:
After updating Gallery to version 2.2.5 you may not be able to login any more!
This is because, during the update process, the file .htaccess is completed cleared.
So the line to get rid of main.php in .htaccess doesn't exist any more, while the base uri setting in config.php is still there!
(see: 11. Prevent duplicate base URLs for your Gallery at the beginning of this thread for details).

The solution is obvious: just edit .htaccess via FTP and add again the line:

# Set the default handler.
DirectoryIndex main.php

And everything will work again :-)
Bye

------------------------------------------
My Gallery sites:
http://www.ruraljourney.com/italy_travelguide/
http://www.zorring.org/

 
evgenydeep

Joined: 2007-05-08
Posts: 23
Posted: Wed, 2008-09-17 07:14

On step 2 i can't see following options on the Admin page, in Dynamic album either on Keyword album.
I have enables URL Rewrite and Permalinks module.
I had the same issue on 2.2.4, and now I upgraded to 2.3RC1, and the same...
I have classic theme by default.

Quote:
On the Site Admin page, go to Keyword Album (and/or Dynamic Albums)
Change Thumbnail links in dynamic albums to Jump to original album, and click Global checkbox if possible.

 
desiredbard

Joined: 2006-07-05
Posts: 80
Posted: Wed, 2009-01-07 00:20

you mentioned a bulk update script.....
that seemed from ur description more functional than the old bulk plugin
iaw
could you make it available please

 
desiredbard

Joined: 2006-07-05
Posts: 80
Posted: Sun, 2009-01-11 21:04

Ok not wanting to be annoying but
http://images.google.ie/images?gbv=2&hl=en&safe=off&q=wedding+party+rachel+stephen+richard+mary+james.

Is a search in google images on some of the keywords TS sais he is using:

The prize question is? Which are ther results

Even idf I take out the common word weddingparty :
http://images.google.ie/images?gbv=2&hl=en&safe=off&q=rachel+stephen+richard+mary+james.

Nothing

So how do you get your photo's listed.
Are we forced to mirror on flickr or use coppermine?

 
smjdesign
smjdesign's picture

Joined: 2007-02-26
Posts: 25
Posted: Mon, 2009-01-12 03:15

@desiredbard Maybe I should rename the post how to SEO for Google and not Google Images. I do show up in Google. I do not know much about how Google Images works. I'm first for quinn castle in the main index and am located three times within the Image Search. I would think that many of your keywords would need to link to actual images instead of pages. Someone should do research on the topic.

Also, I'll have that bulk script for you within a week.

--Stephen
http://www.smjdesign.com
Personal Photo Gallery
http://www.LlamaAndLamb.com/photos/

 
Sean Baden

Joined: 2009-01-12
Posts: 14
Posted: Mon, 2009-01-12 08:40

I'm guessing its your Javascript sidebar. That's the only Javascript on your screen. This is in your actual HTML: <div class="gbBlock giWarning">
JavaScript must be enabled for this page to function properly. However, it seems JavaScript is either disabled or not supported by your browser. Please enable JavaScript by changing your browser options, then try again.

Habe genau das gleiche Problem! Bin am verzweifeln laut Hoster ist deutsch als Sprache installiert.
Sean Baden

 
smjdesign
smjdesign's picture

Joined: 2007-02-26
Posts: 25
Posted: Tue, 2009-01-13 15:18

Title and keyword bulk script update:

Visit my media production blog for more information on the Gallery2 titles and keywords search engine optimization script

I've also removed all the tables from the Matrix theme if anyone would like the theme files. You can view the theme at my Personal Photo Gallery

--Stephen

 
desiredbard

Joined: 2006-07-05
Posts: 80
Posted: Fri, 2009-01-16 11:24

Hi ...sorry I got referred to this topic by an admin
What works as well like a treat but you have to do it everys so often...is the A1 sitemap creator and have that generate a sitemap for you

Now I have recentally moved the whole wherabouts of my site plus linkedin facebook and my companys websitye have a kickarse listing in google but I do show up on the first page in google
Without a lot, if you dont mind me saying, hassle/work

I am actually looking to have the searches show in google images ....gallery2 being photo's and all

Thanks
and keep up the work i am going to restart my thread stating my intentions a bit clearer too

Regards
Bas

 
mridgwel

Joined: 2007-01-27
Posts: 215
Posted: Fri, 2009-02-13 15:57

Google has recently posted something about adding a canonical link reference: : http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html

If you're using matrix you can add this to your theme.tpl just before the head end tag:

{* Add Preferred Canonical Name *}
<link rel="canonical" href="{g->url arg1="view=core.ShowItem"
arg2="itemId=`$theme.item.id`"}" />

_________
Mark

 
pavel.pola

Joined: 2007-05-19
Posts: 30
Posted: Fri, 2009-02-13 16:23

Hi mridgwel, thanks a lot for this hint. It works fine in almost all situations except one. When you are looking on a "keyword album" - virtual album of all photos with the same keyword, then it contains this:

<link rel="canonical" href="/?g2_itemId="/>

Does anybody know how to fix it (change it to i.e. <link rel="canonical" href="http://www.pavelpola.cz/key/krajina"/>)?

_________________________________
Please visit my personal gallery: http://www.pavelpola.cz (mostly B&W pictures, Prague, nature, people)

 
mridgwel

Joined: 2007-01-27
Posts: 215
Posted: Fri, 2009-02-13 17:29

There are a few more situations I've found that it doesn't work in - like the ViewComments - and a few others too - haven't got on to keyword and other dynamic albums yet. When I get that lot working I'll post a better update.

This is what I've got so far:

    {if $theme.pageType == 'album'}

	{if $theme.item.id == null }
	    {* Dynamic album *}		
	    <link rel="canonical" href="{g->url params=$theme.pageUrl forceFullUrl=true}" />

	{else}
	    {* Normal Album *}
	    <link rel="canonical" href="{g->url arg1="view=core.ShowItem"
						arg2="itemId=`$theme.item.id`"
						arg3="page=`$theme.currentPage`"
						forceFullUrl=true}" />

	{/if}

    {elseif $theme.pageType == 'photo'}
	    {* Add Preferred Canonical Name *}
	    <link rel="canonical" href="{g->url arg1="view=core.ShowItem"
						arg2="itemId=`$theme.item.id`"
						forceFullUrl=true}" />
    {elseif $theme.pageType == 'module'}
	
	{if $theme.moduleTemplate == 'modules/comment/templates/AddComment.tpl' }

	    <link rel="canonical" href="{g->url arg1="view=comment.AddComment"
						arg2="itemId=`$theme.item.id`"
						forceFullUrl=true}" />


	{elseif $theme.moduleTemplate == 'modules/comment/templates/ShowAllComments.tpl'}

	    <link rel="canonical" href="{g->url arg1="view=comment.ShowAllComments"
						arg2="itemId=`$theme.item.id`"
						forceFullUrl=true}" />

	{else}

	    <link rel="canonical" href="{g->url params=$theme.pageUrl forceFullUrl=true}" />

	{/if}

    {else}
        <link rel="canonical" href="{g->url params=$theme.pageUrl forceFullUrl=true}" />
    {/if}

I've added this as a separate file called cannonicallinks.tpl which I've included from the theme.tpl using:

{g->theme include="cannonicallinks.tpl"}

but the file also as far as I can tell needs to be in the templates folder as well, even if it just contains the line:

{* This file intentionally left blank *}

_________
Mark

 
pavel.pola

Joined: 2007-05-19
Posts: 30
Posted: Sat, 2009-02-14 07:53

Hi Mark, you did a really good job!

I have made just a few improvements:
- added support for paging in dynamic albums
- added selection if the link is on the first page - then no page number is appended, so URL looks more "SEO friendly" - without any parameter
- added link to search module

Here is my version:

{* Album links *}
{if $theme.pageType == 'album'}
	{if $theme.item.id == null }
		{* Dynamic album *}       
		{if $theme.currentPage > 1}
			<link rel="canonical" href="{g->url params=$theme.pageUrl arg1="page=`$theme.currentPage`" forceFullUrl=true}" />
		{else}
			<link rel="canonical" href="{g->url params=$theme.pageUrl forceFullUrl=true}" />
		{/if}
	{else}
		{* Normal Album *}
		{if $theme.currentPage > 1}
			<link rel="canonical" href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.item.id`" arg3="page=`$theme.currentPage`" forceFullUrl=true}" />
		{else}
			<link rel="canonical" href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.item.id`" forceFullUrl=true}" />
		{/if}
	{/if}

{* Photo links *}
{elseif $theme.pageType == 'photo'}
	<link rel="canonical" href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.item.id`" forceFullUrl=true}" />

{* Module links *}
{elseif $theme.pageType == 'module'}
	{if $theme.moduleTemplate == 'modules/comment/templates/AddComment.tpl' }
		<link rel="canonical" href="{g->url arg1="view=comment.AddComment" arg2="itemId=`$theme.item.id`" forceFullUrl=true}" />
	{elseif $theme.moduleTemplate == 'modules/comment/templates/ShowAllComments.tpl'}
		<link rel="canonical" href="{g->url arg1="view=comment.ShowAllComments" arg2="itemId=`$theme.item.id`" forceFullUrl=true}" />
	{elseif $theme.moduleTemplate == 'modules/search/templates/SearchScan.tpl'}
		<link rel="canonical" href="{g->url arg1="view=search.SearchScan" arg2="form[useDefaultSettings]=1" forceFullUrl=true}" />
	{else}
		<link rel="canonical" href="{g->url params=$theme.pageUrl forceFullUrl=true}" />
	{/if}

{* All other links *}
{else}
   <link rel="canonical" href="{g->url params=$theme.pageUrl forceFullUrl=true}" />
{/if} 

I'm also using "linkspage", which is behaving like admin page - but I didn't find out, how to get the link so I hardcoded this:

{* System links *}
{elseif $theme.pageType == 'admin' && $UserAdmin.subViewName == 'linkspage.Links'}
<link rel="canonical" href="http://www.pavelpola.cz/links" />

If anybody knows how to build admin link to the links page using {g->url} please let me know.

Pavel
_________________________________
Please visit my personal gallery: http://www.pavelpola.cz (mostly B&W pictures, Prague, nature, people)

 
mridgwel

Joined: 2007-01-27
Posts: 215
Posted: Sat, 2009-02-14 21:18

I've updated mine with your changes - works great.

In terms of Admin pages, there are the following things you may be able to switch on - e.g. for my analysis plugin:

$SiteAdmin.subViewName => "mranalysis.BrokenImages"
$SiteAdmin.viewBodyFile => "modules/mranalysis/templates/BrokenImages.tpl"
$SiteAdmin.viewL10Domain => "modules_mranalysis"

Hope this helps.

_________
Mark

 
pavel.pola

Joined: 2007-05-19
Posts: 30
Posted: Sat, 2009-02-14 22:05

I know how to detect it, but I don't know how to build the correct link to that page using {g->url } function.
_________________________________
Please visit my personal gallery: http://www.pavelpola.cz (mostly B&W pictures, Prague, nature, people)

 
mridgwel

Joined: 2007-01-27
Posts: 215
Posted: Sat, 2009-02-14 22:27

Thought I'd put that in!

I don't use that module, but for my admin one, I use:

        <link rel="canonical" href="{g->url arg1="view=core.SiteAdmin"
                                            arg2="subView=mranalysis.BrokenImages"
                                            forceFullUrl=true}" />

If you're on Apache you can reverse engineer this to a certain extent from your .htaccess e.g for the basic admin pages I have the following rule

    RewriteCond %{THE_REQUEST} /admin/(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_view=core.SiteAdmin   [QSA,L]

In the url for it it shows:

http://example.com/admin/?g2_subView=mranalysis.BrokenImages

I've just plugged in the view parameters into the g->url as arg1... argn.

I assume there's a /links entry in the .htaccess. If you need help reverse engineering this then send me the .htaccess entry the send me the lines and I'll try and give you the g->url entry.

You probably have already seen this page that shows how g->url works, but in case you haven't:

http://codex.gallery2.org/Gallery2:Themes:Reference:Tags#url

_________
Mark

 
pavel.pola

Joined: 2007-05-19
Posts: 30
Posted: Sun, 2009-02-15 08:45

Hi Mark, thank you, I forgot to look in .htaccess. Now it's working fine. Just last question - the link it generates looks like this:

http://www.pavelpola.cz/?g2_view=core.SiteAdmin&amp;g2_subView=linkspage.Links

Don't you know, how to force url rewriting function on that link? I'd like to generate it like this: http://www.pavelpola.cz/links. I have the URL rewriting active and correctly defined in .htaccess file. But I need to force the URL generator to generate rewritten link instead of the "basic" one.

Thank you a lot.

_________________________________
Please visit my personal gallery: http://www.pavelpola.cz (mostly B&W pictures, Prague, nature, people)

 
mridgwel

Joined: 2007-01-27
Posts: 215
Posted: Sun, 2009-02-15 22:19

I had that problem with one of the links I did earlier - it was only after spotting that I'd missed something that was in the .htaccess and correcting it that it started using the rewritten one. - the g->url function does the mapping for you. I'm not sure how much of an match it has to be to get generated i.e. ordering of parameters etc.

_________
Mark

 
pavel.pola

Joined: 2007-05-19
Posts: 30
Posted: Mon, 2009-02-16 09:06

My fault, thank you, you're right!
_________________________________
Please visit my personal gallery: http://www.pavelpola.cz (mostly B&W pictures, Prague, nature, people)

 
mridgwel

Joined: 2007-01-27
Posts: 215
Posted: Fri, 2009-03-06 13:54

I've found a minor issue with the root album. Google has unfortunately referenced the root as:

www.example.com/?g2_page=1

To avoid this I have added an additional clause for the root album (ID=7) imediately above the else for the normal album, which does not add the page number

	{elseif $theme.item.id == 7}
	    {* Normal Album (root) - no page number*}
	    <link rel="canonical" href="{g->url arg1="view=core.ShowItem"
						arg2="itemId=`$theme.item.id`"
						forceFullUrl=true}" />

	{else}
	    {* Normal Album *}
	    <link rel="canonical" href="{g->url arg1="view=core.ShowItem"
						arg2="itemId=`$theme.item.id`"
						arg3="page=`$theme.currentPage`"
						forceFullUrl=true}" />

	{/if}

_________
Mark

 
mridgwel

Joined: 2007-01-27
Posts: 215
Posted: Mon, 2009-03-09 20:49

To try and improve my search engine rankings, I've written a module which aids tracking down items which aren't up to standard.

http://codex.gallery2.org/Gallery2:Modules:mranalysis

It's certainly made my life easier tracking down old items without keywords, or bad titles etc. If you have feedback on that it has its own forum for bug reports etc: http://gallery.menalto.com/node/85596

_________
Mark

 
bigu_c
bigu_c's picture

Joined: 2007-10-28
Posts: 421
Posted: Mon, 2009-03-23 11:30

I done more thing already.

But in this case: http://www.car-pictures.us/audi/

I don't know how to change http://www.car-pictures.us/index.php to http://www.car-pictures.us/ in Navbar.

Please tell me how to do.

Thanks!