This project is read-only.

Using admin theme settings on site

Topics: Writing modules, Writing themes
Mar 6, 2014 at 5:26 PM
Thought I would seek the help of the community for some ideas...

The PJS.Bootstrap theme has theme settings that can be set in the Admin area. The values are stored in the database and then retrieved when needed in the shape files.

Sebastien noticed with the mini profiler that with certain pages that contain several shapes which all make calls for the settings, there is A LOT of database traffic.

I've been trying to think of an alternative where I'd be able to retrieve the settings once...perhaps in Document.cshtml...and then store them in such a way that I can access them from any other shape that displays.

Does anyone have possible ideas on a way to implement this type of behavior, or any suggestions on a good way to do this so that the theme isn't hitting the database so much?

Thanks for any ideas!
Mar 6, 2014 at 8:25 PM
Edited Mar 6, 2014 at 8:26 PM
Put them in a kind of Singleton with a lazyloader or in cache ?
I don't like tenants because all the related code transforms Orchard from a Ferrari into a school bus, but as it seems to be the main attraction in this Orchard... we should have an attribute on each setting saying Global or Tenant-related...