Indexing Pages For E-commerce Site |
Post Reply | Page <12 |
Author | ||||||
EarlJ
Newbie Joined: 02-May-2007 Location: United States Status: Offline Points: 4 |
Post Options
Thanks(0)
|
|||||
Sean,
Can you point me to the where is the xml issue addressed? On the Just In page the Canonical URL - Removal of category ID fix hasn't been updated since it was released on 10/12/10 as far as I can see. These files generate an xml sitemap that includes the category number on the URL. Thanks, Earl
|
||||||
Guests
Guest |
Post Options
Thanks(0)
|
|||||
It's complicated. I'm thinking it would be nice if the the category ID were not included when a category is not the context. However, when the category is the context, the current execution makes sense. I just finished a mod that uses the meta title tags on category and product pages to trump the otherwise generated URLs through a couple of functions and light edit on just a few PC pages ... but while doing that, saw that more thinking needs to be done on how tidy to be about URLs produced vs how much to just lean on canonical URL declarations. Obviously, the canonical declarations are there for this very reason -- that dynamic applications will produce various URLs for the same page. However, being tidy about how and where the application generates these URLs in proper context would be elegant if the contextual situations could be handled relatively easily enough to do this. For example: It makes sense to include the category ID on product URLs when browsing by category (pretty important for the way the application handles context here, actually) as well as on "previous/next" navigation on product pages. It might also make sense (at least as an option) to do so on the store map, if products are included on it. It probably doesn't make sense (and would be better to use canonical URLs) on pages such as the home page, best sellers, featured products, new arrivals, recently reviewed & specials. However, what about cross-selling on a product page? Could likely be that cross-sells are in the same category, but certainly can't be assumed. Use a canonical URL or include the category ID ... or, only include the category ID if the cross sell product is in the same category as the product page the user is on? Does it really matter here? Handling the context for whether to show canonical URLs or include the category ID in the URL could be handled pretty easily by making the default link use a canonical URL and then enhancing the logic to detect whether the page calling for pcGenerateSeoLinks() is a category or product page and if so, then include the category ID. With the exception of maybe the store map generation, it would probably be better to use canonical URLs for product links everywhere else. So, at the end of thinking this through, I agree with @whizzinpc -- to put it another way -- that it would be tidier not to use canonical URLs as just a stop-gap, but to generate them in most places by default, except for where it makes sense to include the category ID for the continuity of context in the user's browsing experience.
|
||||||
Guests
Guest |
Post Options
Thanks(0)
|
|||||
Hi Earl, I'm actually not sure when/where this was addressed. I had it in my mind that it hadn't really been, but because of a recent project and this thread, I do see that on 4.5 SP 1, it's no longer an issue. If you'd like fix it in your code, here's what you can do: in genGoogleSiteMapA.asp, look for something like
If your site is generating links with category IDs in them, this line will include the array location pcArr(0,i) Replace the line above with:
HOWEVER, I also discovered another issue here on the recent project I mentioned earlier: the search query creating this record set array will return duplicate product instances when products are assigned to multiple categories. Not elegant, and is probably one of the major reasons I get reports that Google doesn't accept all of the pages fed to it through the XML site map. To address this, the db query needs to be changed as well as the code above. Here's the query:
That will always return all combinations of category ID & product ID in the look-up table, categories_products, and thus the duplicates. As there's no need for the category ID anymore, nor to reference any associations between products and categories here anymore, this query can be replaced with the following:
Changing the query here, though, means that the record set array changes also, so that the patch above for the canonical URLs would need to be changed to:
|
||||||
EarlJ
Newbie Joined: 02-May-2007 Location: United States Status: Offline Points: 4 |
Post Options
Thanks(0)
|
|||||
Wow, thanks for the detailed response and fix.
|
||||||
whizzinpc
Newbie Joined: 17-January-2006 Location: California Status: Offline Points: 20 |
Post Options
Thanks(0)
|
|||||
Thanks so much for that code Sean! I've been using excel to remove the duplicates all this time. Works perfectly now.
|
||||||
Guests
Guest |
Post Options
Thanks(0)
|
|||||
Glad to be helpful.
I still think there are some unresolved issues still here vis a vis canonical URL in context, and I'm pursuing that issue.
|
||||||
Post Reply | Page <12 |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |