Developer forum

Forum » Development » Using the Ecom group selector in a paragraph module

Using the Ecom group selector in a paragraph module

Martin Nielsen
Reply

Hi devs,

I'd like to use your Ecom group selector in a paragraph module, but i'm not sure how i can do it, i'ts basicallly this entire block/control that i would like to use in my module:

Is it possible, or is in some private backend control that is hidden away?

// Martin

 


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Yes, hidden and secret !

Include this control namespace.

<%@ Register TagPrefix="de" Namespace="Dynamicweb.Extensibility" Assembly="Dynamicweb" %>

And this is the markup:

<td>
                        <de:ProductsAndGroupsSelector runat="server" OnlyGroups="true" ShowSearches="true" ID="ProductAndGroupsSelector" CallerForm="paragraph_edit" Width="250px" Height="100px" />
      <input type="checkbox" runat="server" id="IncludeSubgroups" name="IncludeSubgroups" value="1" />
      <label for="IncludeSubgroups">
           <dw:TranslateLabel ID="TranslateLabel2" runat="server" Text="Include subgroups" />
      </label>
     </td>

Do not ask why....

Nicolai

Votes for this answer: 1
 
Martin Nielsen
Reply

Hi Nicolai, 

Works like a charm.

The values i get from these controls look like this:

Shops: [all][s:SHOP1]
Groups: [some][g:GROUP4][g:GROUP5][g:GROUP6]

Have you built a helper function in your API to parse these to a List<string> or similar?

I'f not i'll just do it my self :-)

// Martin

 

 
Nicolai Høeg Pedersen
Reply

Hi Martin

You can use this one:

Dim pgh As New Dynamicweb.Extensibility.ProductsAndGroupsHandler
pgh.ParseData(weirdstring)

And then you get a ParseResult that contains a list of products, groups and shops.

 
Martin Nielsen
Reply

Sweet stuff laughyes

 

You must be logged in to post in the forum