Theme and style

If you name a folder as <ModelName>_AssetsTK and put it next to your <ModelName>.modlr file, or <ModelName>.ecomdl file, the following will happen:

  • <ModelName>_AssetsTK will be included in the Model sent to MDrivenServer when you Upload the model.
  • Once on the server, MDriven Turnkey will unpack the folder in AppData under the name ExtractForExpansionInSite_AssetsTK.
  • Once extracted to ExtractForExpansionInSite_AssetsTK, the MDriven Turnkey application will try to mirror the contents of the following folders from ExtractForExpansionInSite_AssetsTK to AppRoot:

Filename/folder example:

If your modlr filename is products.azurewebsites.net__MDrivenServerA0.modlr, name your folder products.azurewebsites.net__MDrivenServerA0_AssetsTK

Note! Replace the file extension with _AssetsTK.

Folder name Special purpose
EXT_LateBoundAssembly When extending your Turnkey app with C# built logic, your assemblies go here
EXT_Scripts Use this to add your own js files. Add AppWideAngularScriptIncludes.html here and contents will be added to scripts in the app. This is necessary to load things before AngularJS compiles as you need when creating directives.
SiteAssets General purpose
Content This is where the tkusercss.css should be. If you have it, it will be included on your page.
Views\EXT_OverridePages Add your cshtml files here - either name it as a ViewModel to override the whole page or put a matching name as you have in the Content Override ViewModel column in the AngularUIOverride tagged value.
other names You may have any folder depth with any content with special assets and plugins - they will be replicated on the server side.
. Files put in the root of _AssetsTK will be mirrored to the application root. This is where you put a favicon.png that shows in the browser tab.

This enables you to merge your own CSS, styles, and C# assemblies for C# developed logic.

Deleting Files That Were Copied But Should Be Removed

To delete a file by this file replication, you must append .DELETE as an extension. The file copying logic will look for /xxx/something.ext and delete it whenever it finds a file /xxx/something.ext.DELETE in the replicated data.

Update 2019-06-15. Since it has proved cumbersome to use the .DELETE extension, we have introduced the special file CleanAll.txt. If you put such a file in the root level of your AssetsTK directory, all known places and names of assets will be cleaned to the default state. The reason this is done sometimes is that when doing massive file changes on the server, it may restart with this showing up in the log "shutDownMessage Change Notification for critical directories". The ideal way to avoid restarts is to touch as few files as possible - this is what we normally do during expansion. However, sometimes you may want to start over - then use the CleanAll.txt file (the file can be empty).

Practical Issues Identified

2016-12-20 11h23 57.png

When using the AssetsTK file copy strategy, you may have issues with file creation permissions on the server. Check that the IIS_IUSRS has sufficient rights in App_Data.

You may find a file called ExtractForExpansionInSite.log in App_Data. This will explain further issues with file creation:

Problem expanding AssetsTK:Access to the path 'C:\inetpub\wwwroot\MTTK\App_Data\..\Content\Something.png' is denied.

Time: 11:19:12

If this is the case, fix it by giving access to the IIS user.

More on practical CSS work with Turnkey: MDriven_Turnkey_theming

This page was edited 158 days ago on 06/17/2024. What links here