Thirteen Ways To Add SEO To Gallery2
skunker
Joined: 2005-02-04
Posts: 344 |
![]() |
How do you edit CLASS files? Dreamweaver won't open that file. |
|
ultravista
Joined: 2006-10-08
Posts: 121 |
![]() |
notepad or other text editor. I use UltraEdit. |
|
pavel.pola
Joined: 2007-05-19
Posts: 30 |
![]() |
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 |
![]() |
Sorry, my fault, everything seems to be ok, the problem was in my local cache... |
|
pavel.pola
Joined: 2007-05-19
Posts: 30 |
![]() |
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. |
|
maravizzo
![]()
Joined: 2005-09-11
Posts: 49 |
![]() |
Solved problem: Cannot login after update For the people that, like me, are implementing these techniques to get a better SEO in Gallery: 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 ------------------------------------------ |
|
evgenydeep
Joined: 2007-05-08
Posts: 23 |
![]() |
On step 2 i can't see following options on the Admin page, in Dynamic album either on Keyword album. Quote:
On the Site Admin page, go to Keyword Album (and/or Dynamic Albums) |
|
desiredbard
Joined: 2006-07-05
Posts: 80 |
![]() |
you mentioned a bulk update script..... |
|
desiredbard
Joined: 2006-07-05
Posts: 80 |
![]() |
Ok not wanting to be annoying but 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 : Nothing So how do you get your photo's listed. |
|
smjdesign
![]()
Joined: 2007-02-26
Posts: 25 |
![]() |
@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 |
|
Sean Baden
Joined: 2009-01-12
Posts: 14 |
![]() |
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"> Habe genau das gleiche Problem! Bin am verzweifeln laut Hoster ist deutsch als Sprache installiert. |
|
smjdesign
![]()
Joined: 2007-02-26
Posts: 25 |
![]() |
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 |
![]() |
Hi ...sorry I got referred to this topic by an admin 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 I am actually looking to have the searches show in google images ....gallery2 being photo's and all Thanks Regards |
|
mridgwel
Joined: 2007-01-27
Posts: 215 |
![]() |
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 *} _________ |
|
pavel.pola
Joined: 2007-05-19
Posts: 30 |
![]() |
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"/>)? _________________________________ |
|
mridgwel
Joined: 2007-01-27
Posts: 215 |
![]() |
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 *}
_________ |
|
pavel.pola
Joined: 2007-05-19
Posts: 30 |
![]() |
Hi Mark, you did a really good job! I have made just a few improvements: 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 *} If anybody knows how to build admin link to the links page using {g->url} please let me know. Pavel |
|
mridgwel
Joined: 2007-01-27
Posts: 215 |
![]() |
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" Hope this helps. _________ |
|
pavel.pola
Joined: 2007-05-19
Posts: 30 |
![]() |
I know how to detect it, but I don't know how to build the correct link to that page using {g->url } function. |
|
mridgwel
Joined: 2007-01-27
Posts: 215 |
![]() |
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 _________ |
|
pavel.pola
Joined: 2007-05-19
Posts: 30 |
![]() |
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:
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. _________________________________ |
|
mridgwel
Joined: 2007-01-27
Posts: 215 |
![]() |
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. _________ |
|
pavel.pola
Joined: 2007-05-19
Posts: 30 |
![]() |
My fault, thank you, you're right! |
|
mridgwel
Joined: 2007-01-27
Posts: 215 |
![]() |
I've found a minor issue with the root album. Google has unfortunately referenced the root as: 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}
_________ |
|
mridgwel
Joined: 2007-01-27
Posts: 215 |
![]() |
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 _________ |
|
bigu_c
![]()
Joined: 2007-10-28
Posts: 421 |
![]() |
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! |
|