an ASP.NET Open Source CMS & eCommerce platform
Search:
Last Post 8/19/2010 2:15:22 PM By Bahram. 6 replies.
8/18/2010 10:27:58 AM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Tag Cloud
What is Tag Cloud block for, It has just Edit header and Edit Condition, How Can I use tags.
 
8/18/2010 10:52:56 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Tag Cloud
DotShoppingCart Staff
8/19/2010 10:34:10 AM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Re: Tag Cloud
 There is no way to add articles , no menu item
8/19/2010 10:40:03 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Tag Cloud
DotShoppingCart Staff
8/19/2010 1:30:15 PM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Re: Tag Cloud
I added Articles and after adding Tags the was erros. Now when I open my default page this error happens and I can not go to the pahge editor :
--------------------------------------------------------------------------------
Attempted to divide by zero.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.DivideByZeroException: Attempted to divide by zero.
Source Error:

Line 40:                 foreach (var t in tags.OrderBy(t => t.Rank)) {
Line 41:                     current += t.Cnt;
Line 42:                     t.FontSize = maxFontSize - delta * current / total;
Line 43:                 }
Line 44:
 
Source File: d:\AcrEStore_4.0\Web\View\Blocks\TagCloud.ascx.cs    Line: 42
8/19/2010 1:50:46 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Tag Cloud
The bug was fixed in the latest version. You can change the code to the following
 
                decimal delta = maxFontSize - minFontSize;
                long total = tags.Sum(t => t.Cnt);
                if (total > 0) {
                    long current = 0;
                    foreach (var t in tags.OrderBy(t => t.Rank)) {
                        current += t.Cnt;
                        t.FontSize = maxFontSize - delta * current / total;
                    }

                    rptTags.DataSource = tags;
                    rptTags.DataBind();
                }
DotShoppingCart Staff
8/19/2010 2:15:22 PM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Re: Tag Cloud
Did it now this error :
 
Sequence contains more than one matching element
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Sequence contains more than one matching element
Source Error:

Line 145:                        else
Line 146:                            preArticle.Groups = groups;
Line 147:                        preArticle = articles.Single(a => a.ArticleId == ga.ArticleId);
Line 148:                        groups = new List<Group>();
Line 149:                    }
 
Source File: d:\AcrEStore_4.0\Web\View\ArticleListControl.ascx.cs    Line: 147