I have a template that has an image tag inside of it. I want to append the DNN CDF version to the image. So for example, when I increment the CDF version and skin.css?cdv=74, then the image tag inside of my 2sxc razor templates will also get pushed to src="@Content.Image?cdv=74" so any updates to the image don't get stuck with browser caching. Is this possible and how would I do it?
Asked
Active
Viewed 54 times
2 Answers
1
In short, you can get it using the servicesFramework via the following:
serviceFramework.get("ServerSettingsPerformance", "GetPerformanceSettings")
Here is an example of how it is done within DNN.

David Poindexter
- 488
- 4
- 12
-
Thanks. How would I write this in C# Razor template in a 2sxc app? – Aaron - Wolf X Machina Apr 20 '21 at 03:00
-
This client-side code (JavaScript), which you can use within the 2sxc Razor template. – David Poindexter Apr 20 '21 at 13:56
0
In case you want it on the server, I believe the PortalSettings in newer Dnns (not in v7) has it https://dnndocs.com/api/DotNetNuke.Abstractions.Portals.IPortalSettings.html#DotNetNuke_Abstractions_Portals_IPortalSettings_CdfVersion
So probably @Dnn.Portal.CdfVersion

iJungleBoy
- 5,325
- 1
- 9
- 21
-
Ahh, amazing. This is it and it ouputs the portal version as expected. Is there a way to get the instance CDF version? – Aaron - Wolf X Machina May 05 '21 at 17:02
-
I think the portal is the site - so that should be the instance CDF -or do you mean something else by instance-cdf? – iJungleBoy May 07 '21 at 09:32
-
CDF can be global, or portal. Most of my sites use the global CDF setting (instance wide for all portals). – Aaron - Wolf X Machina May 07 '21 at 18:11