How can you access SiteFinity DigitalConfig variables on a SiteFinity page?

39 Views Asked by At

My client's SiteFinity administration site has the ability to add DigitalConfig variables. Unless I'm mistaken, these are built into the SiteFinity framework.

I know we are accessing them through an MVC call somehow in a company-native project, but I need to check a boolean flag from these variables on a SiteFinity content page. Is there any way of doing so in a javascript block on the page, or does this sound like something beyond SiteFinity that's been added?

1

There are 1 best solutions below

0
Veselin Vasilev On

I assume you are talking about Config settings that can be accessed from Administration > Settings > Advanced in the backend.

You will need to know the exact setting you are looking for and then you can get its value using the API (https://www.progress.com/documentation/sitefinity-cms/administration-settings-and-configurations)

So, to access a config setting in javascript in your mvc view, you can do something like this:

<script>
    var allowedExtensions = '@(Telerik.Sitefinity.Configuration.Config.Get<Telerik.Sitefinity.Modules.Libraries.Configuration.LibrariesConfig>().Images.AllowedExensionsSettings)';
</script>