I'm still working on this.
Logan, here is what I meant when I asked for the reverse of the code, but I wasn't too clear.
(I just spent an hour modifying categorygrid3.ascx for our display needs, then remembered that it won't pick up the order of the products in the admin- it starts out sorting by name.)
I need to either
1. Change categorygrid3.ascx to sort products the way they are in the admin. The patches on the forum now don't work on this display page. I think this is what controls the original display:
ProductList.DataSource = ProductDataSource.NarrowSearch(_Keywords, this.CategoryId, _ManufacturerId, 0, 0, _PageSize, (_HiddenPageIndex * _PageSize), SortResults.SelectedValue);
2. Fix categorygrid4.ascx to not show the C in the URLs, like the following code does.
//OUTPUT LINKED NAME
itemTemplate1.Controls.Add(new LiteralControl(string.Format("<a href=\"{0}\" class=\"highlight\">{1}</a><br />", catalogNodeUrl, catalogNode.Name)));
It would probably be a quick fix from Logan or sohaib.
issue with URL rewrite?
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: issue with URL rewrite?
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: issue with URL rewrite?
Yes, we use category4 and I think it was the only able issued page the included the C in the url.
Also, any feedback on what Judy mentioned above would be greatly appreciated
Also, any feedback on what Judy mentioned above would be greatly appreciated
I did run across some code in a 5.5 store that came from 4.x where they had set up an .htaccess file for redirects. It starts out like:
# Helicon ISAPI_Rewrite configuration file
# Version 3.0.0.31
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: issue with URL rewrite?
I've finally come up with a fix in the CategoryGrid4.ascx. I put conditional code in to use in case the grid was displaying categories and added new code to display the ProductURL on the thumbnail and name if it is a product.
Code: Select all
if ((itemTemplate1 != null) && (itemTemplate2 != null))
{
CatalogNode catalogNode = (CatalogNode)e.Item.DataItem;
string catalogNodeUrl = this.Page.ResolveClientUrl(catalogNode.NavigateUrl);
//jme 070808 get rid of c in product url
if (catalogNode.CatalogNodeType == CatalogNodeType.Category)
{
//OUTPUT LINKED THUMNAIL
if (!string.IsNullOrEmpty(catalogNode.ThumbnailUrl))
{
string thumbnail = string.Format("<a href=\"{0}\"><img src=\"{1}\" alt=\"{2}\" border=\"0\" class=\"Thumbnail\" /></a><br />", catalogNodeUrl, ResolveUrl(catalogNode.ThumbnailUrl), catalogNode.ThumbnailAltText);
itemTemplate1.Controls.Add(new LiteralControl(thumbnail));
}
//OUTPUT LINKED NAME
itemTemplate1.Controls.Add(new LiteralControl(string.Format("<a href=\"{0}\" class=\"highlight\">{1}</a><br />", catalogNodeUrl, catalogNode.Name)));
}
//OUTPUT RETAIL PRICE IF AVAILABLE and URLs for Product without "C" in URL
if (catalogNode.CatalogNodeType == CatalogNodeType.Product)
{
Product product = (Product)catalogNode.ChildObject;
string productUrl = product.NavigateUrl;
productUrl = this.Page.ResolveClientUrl(productUrl);
if (!string.IsNullOrEmpty(product.ThumbnailUrl))
{
string thumbnail = string.Format("<a href=\"{0}\"><img src=\"{1}\" alt=\"{2}\" border=\"0\" class=\"Thumbnail\" /></a><br />", productUrl, ResolveUrl(product.ThumbnailUrl), product.ThumbnailAltText);
itemTemplate1.Controls.Add(new LiteralControl(thumbnail));
}
//OUTPUT LINKED NAME
itemTemplate1.Controls.Add(new LiteralControl(string.Format("<a href=\"{0}\" class=\"highlight\">{1}</a><br />", productUrl, product.Name)));
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: issue with URL rewrite?
Code worked great Judy
But since google has already indexed my site with the C in the URL it's still reporting it with a duplicate Title - will it consider this duplicate content?
Since the C part of the URL doesn't effect the page that loads, this means Google will continue to look at ~P#C#.aspx versus just ~P#.aspx and still load the page. How do you remove the extra URL's with the C if google already has them indexed and the page isn't 404'd? would a restriction on the bot suffice?
Is there a way to disable the URL from loading if it includes the C
But since google has already indexed my site with the C in the URL it's still reporting it with a duplicate Title - will it consider this duplicate content?
Since the C part of the URL doesn't effect the page that loads, this means Google will continue to look at ~P#C#.aspx versus just ~P#.aspx and still load the page. How do you remove the extra URL's with the C if google already has them indexed and the page isn't 404'd? would a restriction on the bot suffice?
Is there a way to disable the URL from loading if it includes the C
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: issue with URL rewrite?
I just don't know. I think you can submit links to google to have them removed. There is also a new meta tag for canonical definition of links so that you can tell the search engine what one to use. I've see a little info on it, but haven't looked into it yet.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: issue with URL rewrite?
Thanks for the tip Judy. I'll probably look at trying to get them removed from the google index since it should be a one time fix as the URL's are no longer mapped on the website.
I looked at the canonical meta tags and as far as i can tell they are static references to the "main" page and are placed in each of the duplicate pages. There's probably some sneaky way to code it into the backend to rewrite the link so it is pointing at the correct page, but with my limits it would require me to add the tag to each of my products.
The canonical meta tag may be useful for multiple category pages though, I haven't looked much at it, but I did see that google was marking duplicate titles for different pages of the same category. A canonical meta tag for these to point at the first page only may prove to be useful.
I looked at the canonical meta tags and as far as i can tell they are static references to the "main" page and are placed in each of the duplicate pages. There's probably some sneaky way to code it into the backend to rewrite the link so it is pointing at the correct page, but with my limits it would require me to add the tag to each of my products.
The canonical meta tag may be useful for multiple category pages though, I haven't looked much at it, but I did see that google was marking duplicate titles for different pages of the same category. A canonical meta tag for these to point at the first page only may prove to be useful.