Lining up products with Long Names

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

Lining up products with Long Names

Post by William_firefold » Wed Apr 22, 2009 10:57 am

We have been having a ton of trouble getting products to line up on the front page and on category pages when we have products with long file names. Trying to get Even rows has been almost impossible and has resulted in a lot of wasted space to make up for the space that long names take up.

I finally got around to coming up with a solution and I thought others might be interested.
In our case, we have only put this fix in Conlib:ItemBought for now but we may use it in other place later.

Find the ASP hyperlink in the ItemBought.ascx file around line 22 and change to this:

Code: Select all

<asp:HyperLink ID="NameLink" runat="server" Text='<%# Eval("Name").ToString().Length >= 50 ? Eval("Name").ToString().Substring(0, 50)+"..." : Eval("Name").ToString()  %>' NavigateUrl='<%#Eval("NavigateUrl")%>'></asp:HyperLink><br /><br />
This will chop file names over 50 Characters long and add an elipsis...
Hope this helps.

Post Reply