Page Level canonical in the yahoo store
Lets say that for years you did not know about a 301 redirect in the yahoo store and you just found out, you maybe thinking that you will lose the page ranking that you have at this time with all the WWW in the URL well we can help fix that with page level canonical. Canonical is somewhat new to the world of the web and is a field that Google and Yahoo both use so lets build one in RTML for your store! Another reason that you might need a Canonical link is you may be changing the name or URL of some of your items in the store and would not like to lose page rank on that item! this will all help.
we will start with the RTML in the main template you use and if you follow me at all then it would be storetemplate (with out the . in it)
we will add this right after the keywords and we will be making its own template so inset CALL then hit edit and add “:canonical” with out the quotes
Now lets click on the template link at the top and click on “new template”. Now this is the first time in my blog i have had you create a new template and there are a few important items to keep in mind. each new template defaults to having a head tag, title tag and a body tag, we will be removing them but not yet because if you remove all three of the tags you will have a nil template and have to trash it and start again. so we will add the first TEXT operator and “paste after” the BODY tag, that way we can remove the other tags that we don’t need by clicking the BODY tag then hit the “cut” button from there do the same with the HEAD tag and that will also remove the title tag. Now we can continue our work
<– This is the end product
Now lets add the field “Canonical” to the product table, that will be in the catalog manager under table then just add a text type field with the name canonical. and one last note to this is that you can keep the canonical field blank and it will grab the page ID and use that unless you would like to tell the search engine that this is not the page you would like it to index in that case just add the ID of the page you would like it to index, you don’t need to add .html or anything else. seems easy but if you have any questions feel free to post.
13 Comments
Other Links to this Post
-
custom 404 page | E-comm Solution — July 15, 2010 @ 5:35 pm
RSS feed for comments on this post.
Leave a comment
You must be logged in to post a comment.

ByBen Pollak , April 21, 2010 @ 5:40 pm
how bout a quick explanation of process for removing unneeded RTML operators?
By E-comm
, April 21, 2010 @ 8:55 pm
OK, i updated the info to explain the removal of the rtml
By jameswi
, September 28, 2010 @ 9:13 am
When you create the new template, what is the ID and type (sorry, I am new to RTML)?
By jameswi
, September 28, 2010 @ 9:16 am
Forgot to ask, as an alternative, could you override the Head-tagss variable and insert PHP to do something like this:
// Permanent redirection
header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: http://www.somacon.com/“);
exit();
?>
Just not sure if you can insert PHP code.
By E-comm
, September 28, 2010 @ 9:28 am
You can not insert PHP into the store. It would be nice but will not work. as for your first question we creating a new RTML template there is no type or ID, I think you are looking at a new item or page under contents. make sure you check out this post first http://e-commsolution.com/getting-started-with-rtml/
By jameswi
, September 28, 2010 @ 3:09 pm
My bad, I was in the wrong place… and knew that. However, what should the name of the template be, canonical or .canonical?
Also, it’s funny you said you can’t insert PHP code, because a support rep at Yahoo told me to to this, and I tried it and couldn’t get it to work (the script didn’t get run, of course).
By E-comm
, September 29, 2010 @ 6:25 am
Custom templates can not have any . in there name. but welcome to our blog and enjoy all the info we have for the yahoo platform.
By jameswi
, September 29, 2010 @ 8:27 am
After entering the conditions, when I try to save the IF statement my changes are lost. I am guessing keywords like NONEMPTY and TEXT have to be created and then inserted. Is there a trick to this?
By jameswi
, September 29, 2010 @ 8:44 pm
Phew, I did it, thanks!
By E-comm
, September 29, 2010 @ 9:39 pm
Vary good, glad we can help out. would love to see the site when you are done and feel free to make suggestions for other write ups.
By jameswi
, September 29, 2010 @ 10:01 pm
Okay, now that I have a clue… in the above script, shouldn’t the line after then read TEXT @canonical instead of TEXT “.html\” />”? Otherwise, the id of the redirect page is never part of the URL.
Also, why include a canonical at all if the page has not moved? Why not just leave it nil?
By E-comm
, September 30, 2010 @ 6:12 am
You are right, it should be @canonical, and as for leaving it nil; that is an option, right now it will create a canonical for the page regardless but you have the option to over ride it if you need to.