dotnetnukedotnetnuke-9

DNN 9 SPA Module QuickSettings


I am very sorry to have to do a post like this, but I have been looking everywhere and I have not found a good example of how to use/reference quick settings on a SPA module for DNN 9. IS there anyway that someone could point me to some sample code or give an example of how you can save/reference a modules quick settings.


Solution

  • My Restaurant Menu example module has a SPA version that with a full, working implementation of the Quick Settings.

    Edit: In my above example, I just access the setting in the controller webAPI method for the view. If you would like to spit out the setting as a SPA token in your view html, you use [ModuleContext:{SettingName}].

    In my above example, I am setting the module setting in with the following code:

    ModuleController.Instance.UpdateModuleSetting(ActiveModule.ModuleID, "RestaurantMenu_CurrencyCulture", settings.CurrencyCulture);
    

    The second parameter is the setting's dictionary key name. Therefore, to get this setting value in the View.html, I would use the following SPA token: `

    [ModuleContext:RestaurantMenu_CurrencyCulture]