Sharing flash tagcloud (wpCumulus) integration

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
Hello,

If someone want to include flash tagcloud (wpCumulus) in it's nop store like this example
http://www.extensions-cheveux-naturels.fr/
here is a solution :

1 - go to http://flashtagcloud.codeplex.com/, download the current release, extract the file wpCumulus.dll (in release folder), and add this dll to references of your project NopCommerceStore

2 - Create a new user control named PopularFlashTags.ascx

3 - Open the ascx and add this
<%@ Register assembly="wpCumulus" namespace="wpCumulus" tagprefix="cc1" %>
<div class="block block-popular-tags">
      <cc1:WPCumulus ID="WPCumulus1" runat="server" DataCountField="ProductCount"
        DataTextField="Name" DataUrlField="Link" Width="245" Height="215"
        BackColor="#f1e8e0" HiColor="#f13e7b" TagColor1="#f13e7b" TagColor2="#777777"  Distr="True"  />
</div>


Here you will be able to change colors and size of the flash control

4 - Open the aspx.cs file and add this

protected override void OnPreRender(EventArgs e)
{
    BindData();
    base.OnPreRender(e);
}

protected void BindData()
{

    //get all tags
    int maxItems = 20;
    var productTags = ProductManager.GetAllProductTags(0, string.Empty);
    if (productTags.Count == 0)
    {
        this.Visible = false;
    }
    else
    {

        List<ProductTag> cloudItems = new List<ProductTag>();
        for (int i = 0; i < productTags.Count; i++)
        {
            ProductTag productTag = productTags[i];
            productTag.Link = CommonHelper.GetStoreLocation() + "producttag.aspx?tagid=" + productTags[i].ProductTagId;
            if (i < maxItems)
            {
                cloudItems.Add(productTag);
            }
        }

        WPCumulus1.DataSource = cloudItems;
        WPCumulus1.DataBind();
    }
}


5 - Add this property to ProductTag class :
  
public string Link { get; set; }


6 - download Slimbox v2.04 and replace the actual 2.01 included in nopCommerceStore/Script folder, orelse you will have a bug on all flash components

7 - Compile and insert you new user control in a page or master page
<%@ Register TagPrefix="nopCommerce" TagName="PopularFlashTags" Src="~/Modules/PopularFlashTags.ascx" %>

and then
<nopCommerce:PopularFlashTags ID="popularTags" runat="server" />


Hope it helps!

Regards,
Nicolas
13 years ago
Great !!!
Thanks for sharing this Nicolas...i will try this soon....
13 years ago
Ok i tried adding this feature

after following all the above mentioned steps: whenever i try to re-build the project it gives me Build Error/Failed

i even tried adding this namespaces:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Text;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using NopSolutions.NopCommerce.BusinessLogic.Products;
using NopSolutions.NopCommerce.BusinessLogic.SEO;
using NopSolutions.NopCommerce.Common.Utils;
using NopSolutions.NopCommerce.Controls;

but still no use....i guess something is missing in the steps....
13 years ago
What build error do you get?
13 years ago
nicolas, what version of nopCommerce are you using?

I'm having problems with the line

productTag.Link = CommonHelper......

It's telling me Link is not a property of ProductTag
13 years ago
Shame on me!

I forgot to tell you that I have added a Link property on ProductTag class :

        public string Link { get; set; }

I have corrected my post... and I hope I did not forgot anything else!

Sorry!
13 years ago
nicolas,

Thanks!
13 years ago
Might also want to make the following change to the code behind of the new PopularFlashTags control:

change:

public partial class PopularFlashTags : System.Web.UI.UserControl

to:

public partial class PopularFlashTags : BaseNopUserControl

To allow access to things like "GetLocaleResourceString" among other Nop goodies.
13 years ago
The control bugs out when you click on a thumbnail picture on a product's details.

Clicking a thumbnail enlarges the pict and you can see the cloud's text disappear.  After closing the thumbnail's window, the site is hung up and no cloud is displayed.

I'm using IE8, NopCommerce 1.60, and Win7 64bit.

I think I'm going to have to remove it.
13 years ago
this bug is comming from slimbox script, you must download Slimbox v2.04 and replace the actual 2.01 included in Script folder
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.