Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

How to get the list of items from a property dropdown?


How to get the list of items from a property dropdown ? 

eg: We have a page property named 'bgColour'.  It's dynamically populated in the editor via the 'bgColourSelectionFactory'.  Some example values may be:

  1. Blue
  2. Red
  3. Yellow
  4. Green

These values are created in the Admin (using the AddOn.Episerver.Settings.Core.SettingsBase object) and may be added to or removed at any time.

The bgColour page property just contains the text value from the dropdown.  eg: 'Red'

How can I get this list of items (Blue, Red, etc) from within a Scheduled Job?  I'm trying to read the values, and add any missing values to the list.



Edited, Sep 04, 2023 14:51

We are using this nuget package AddOn.Episerver.Settings.Core for our Global Settings.

Upon reading the docs: I realized that the following method was missing:

var mysetting = settingsService.GetSetting<MenuSettings>();

VS was getting confused between our custom settingService with the same name as the setting service in AddOn.Episerver.Settings.Core!  Once I used the entire namespace to grab the setting service, I was able to access the correct methods.

Sep 05, 2023 13:12
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.