Search code examples
razordotnetnuke2sxc

How can I output the CDF version inside a C# Razor template in 2sxc?


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?


Solution

  • 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