List the checkbox in the popup window like "Category" in Alloy template?

Vote:
 

Hi EPiServer dev team


I follow Linus's article (http://world.episerver.com/Blogs/Linus-Ekstrom/Dates/2012/9/EPiServer-7-Configuring-editors-for-your-properties/) to create a multi-select list, however I have a lot of the select options, e.g. max 120 options. It makes the Admin UI looks very unmanaged. 

Can someone point me to the right direction how to make load these options into a popup like the "Category" popup in EPiServer 7?

 

Thanks

#69859
Apr 08, 2013 16:06
Vote:
 

I think the property you are looking for is CategoryList.

#69864
Apr 08, 2013 18:33
Vote:
 

Hi Chris

I don't think CategoryList meet my requirement, cuz I need to populate the dynamic list which are not stored in the category table.

e.g. I have a news pagetype that can be associated/tagged with multiple product pages, if the site has 200 products, the admin UI looks urgly. 

#69874
Apr 09, 2013 3:41
Vote:
 

Would anyone else give me a suggestion?

#69898
Apr 09, 2013 12:55
Vote:
 

Where do the options come from? If they are pages/content you could use a content area. Crude but efficient. Other than that I think you'll have to create a custom editor.

#69899
Apr 09, 2013 13:22
Vote:
 

Hi Joel

 

Thanks for your reply. 

I have a news pagetype that requires to be linked to many products (product pagetype), so when user visits the product page, it will display all the related news at the bottom of the page.

My current implementation is using the custom editor approach as I mentioned in my original post which lists all the products page as a checkbox list (simliar to what Linus's MultipleLanguage descriptor), it works indeed. However due to the product page growth so quick, probably will reach to 200, it makes the editor page too long and hard for content editor to find the extract product to be linked with the news. 

So I am thinking to load all the products as checklist box in a popup, like the Category field in CMS. I hope the above explanation does make sense.

#69907
Apr 09, 2013 15:30
Vote:
 

What type of property is it? A content area?

#69908
Apr 09, 2013 15:36
Vote:
 

no, it's a pagetype

#69909
Apr 09, 2013 15:40
Vote:
 

Hmm, I'm not sure I follow. I thought you had a property which the editor should populate with one or more pages (products)?

#69910
Apr 09, 2013 15:41
Vote:
 

yes, your are right. 

see my screen shot http://i46.tinypic.com/2ng7cs1.jpg

 

#69911
Apr 09, 2013 15:52
Vote:
 

[If I understand your situation correctly...] Another approach you could do is to make the property on the news page a LinkItemCollection, then pick the product pages through that. Then on your product page, find all the news pages, and parse through the collection to see if the current product page is in that collection.

#69912
Apr 09, 2013 16:20
Vote:
 

Hi Chris

Thanks for your reply. Your suggested approach was my initial approach, but LinkCollection operation is too complex, and client doesn't quite like it. That's the reason of choosing my current approach.

#69913
Apr 09, 2013 16:25
Vote:
 

Hi,

I think CategorySelector widget would be the best to your needs. Eventhough it is unfortunately tightly coupled with category data, you can still overwrite some methods to make it works with your data. Below is my illustration:

- Make sure that your property value is an array of { id, description } objects. If not, it should be fairly easy to have it normalized.

- Refactor your check box list widget to work with that data format

- Create a new widget which inherits epi-cms/widget/CategorySelector. There are few methods need to be overriden:

    1) _getCategory(id): Return a promise that rersolves a value item from id. You could do some server request or query some sort of preloaded data here.

    2) _createDialog(): Create a epi/shell/widget/dialog/Dialog instance whose content is your checkbox list. Important to assign the dialog instance to this.dialog and your checkbox list widget instance to this.categorySelectorDialog.

I am not 100% sure that it would work painlessly but if you are feeling lucky today, give it a try.

#69968
Apr 10, 2013 11:09
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.