Last active
August 29, 2015 14:03
-
-
Save contensis/07bb66a5d7ff118ba288 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'----------------------------------- | |
' Contensis - Custom Code (Page PreLoad) | |
' | |
' Add to your base template | |
' | |
' Append the content version number to CSS Link URL to prevent caching | |
' e.g. <link href="/siteelements/assets/css/main.css?version=81002" rel="stylesheet" type="text/css" /> | |
' | |
'----------------------------------- | |
For Each item As CMS_API.Utilities.controls.StyleSheet In StyleSheets.Controls | |
Dim FolderID as integer = CMS_API.Utilities.NavigationXMLHelper.Instance.GetFolderIDFromPath(System.IO.Path.GetDirectoryName(item.href).replace("\","/")) | |
Dim ContentID as integer = CMS_API.Utilities.NavigationXMLHelper.Instance.GetFolderChildByName(FolderID,System.IO.Path.GetFileNameWithoutExtension(item.href),CMS_API.Utilities.NavigationXMLHelper.MenuType.contentitem) | |
Dim Element As System.XML.XmlElement = CMS_API.Utilities.NavigationXMLHelper.Instance.GetContentElement(ContentID) | |
'response.write(ContentID) | |
If Element IsNot Nothing Then | |
If Element.Attributes("version") IsNot Nothing Then | |
item.Href += "?version=" & Element.Attributes("version").Value | |
End If | |
End If | |
Next |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment