YAFLogo

Ordinary Nimda
9 years ago
I would like to change CSS file names (like adding incremental counters, or using a date modifier in the file names), which would force a new version to be downloaded to the client. DNN has this problem solved in an elegant way, but I did not find where YAF has these filenames specified. The following excerpt illustrates these files:


<!-- this is the bottom part of the HEAD element child nodes in a DNN page with the YAF module -->
<link href="/DesktopModules/YetAnotherForumDotNet/Content/forum.min.css" rel="stylesheet" type="text/css" />
<link href="/DesktopModules/YetAnotherForumDotNet/Themes/BlueGrey/theme.css" rel="stylesheet" type="text/css" />
<link href="/desktopmodules/yetanotherforumdotnet/content/themes/smoothness/jquery-ui.min.css" rel="stylesheet" type="text/css" />

<style type="text/css">#simplemodal-overlay{background-color:#000;}</style>
<meta name="viewport" content="width=device-width,initial-scale=1" />

<script type="text/javascript" src="/DesktopModules/YetAnotherForumDotNet/Themes/BlueGrey/js/ColorGrey.js"></script>
<script type="text/javascript" src="/DesktopModules/YetAnotherForumDotNet/Scripts/jquery-ui-1.11.4.min.js"></script>

For example, I would like to change the name of "theme.css" to "theme.0001.css", and of course would increment the counter after more updates next week, etc.

Sponsor
Ordinary Nimda
8 years ago
I solved this problem:

  • Make a copy of a theme, and give it a name, and use that name for the folder. (e.g. BlueGrey_001)
  • Put this name in the header of the new XML file (e.g. BlueGrey_001, two occurrences in LINE 2).
  • Replace all original names in the YAF module yafdnn-res.zip.manifest file with the new name (e.g. BlueGrey_001 instead of BlueGrey)
  • Go to the ADMIN section of the forum web interface, and select the new skin, and SAVE it.
The resulting THEME.CSS in the forum module page output is now pointing to the proper directory. After doing another set of updates on a new copy of _001, just replace the _001 in the XML and the Manifest file with _002. Now, select the new skin in the ADMIN section of the web, then, delete the _001 folder and _001.XML file in the /themes/ folder, to clean up.

This overrides any caching mechanisms on the client side, and ensures the clients have an up-to-date YAF DNN Module CSS in their browsers.