Page 1 of 1

Links and new window

Posted: Mon Jul 13, 2009 7:04 am
by jmestep
Could someone check this out before I submit a bug report?
On 7.0.2 and 7.0.3, add a link to an external site using the Add link function.
Set it to use direct link and select new window (_blank) from the dropdown.
The page doesn't open in a new window it replaces the page in the site.

Re: Links and new window

Posted: Mon Jul 13, 2009 7:25 am
by mazhar
Yes there seems to be some problem. I have checked this with 7.0.3 on Category Page with data. Going to report it for 7.0.3.

Re: Links and new window

Posted: Mon Jul 13, 2009 7:28 am
by mazhar
Issue logged, you can track progress here
http://bugs.ablecommerce.com/show_bug.cgi?id=8220

Re: Links and new window

Posted: Mon Jul 13, 2009 10:12 am
by jmestep
Is it something you can post a patch of code for? We've got a client ready to go live and I'll have to try something if you can't!
Thanks

Re: Links and new window

Posted: Mon Jul 13, 2009 10:26 am
by mazhar
In categorygridpage4 locate following code

Code: Select all

//OUTPUT LINKED NAME
                itemTemplate1.Controls.Add(new LiteralControl(string.Format("<a href=\"{0}\" class=\"highlight\" target=\"{1}\">{2}</a><br />", catalogNodeUrl,target ,catalogNode.Name)));
and update it as

Code: Select all

string target = string.Empty;

if (catalogNode.CatalogNodeType == CatalogNodeType.Link)
target = ((Link)catalogNode.ChildObject).TargetWindow;
//OUTPUT LINKED NAME
                itemTemplate1.Controls.Add(new LiteralControl(string.Format("<a href=\"{0}\" class=\"highlight\" target=\"{1}\">{2}</a><br />", catalogNodeUrl,target ,catalogNode.Name)));