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.
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.
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.
Hmm, I'm not sure I follow. I thought you had a property which the editor should populate with one or more pages (products)?
yes, your are right.
see my screen shot http://i46.tinypic.com/2ng7cs1.jpg
[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.
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.
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.
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