🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Turnkey extra meta tags
This page was created by Hans.karlsen on 2021-05-28. Last edited by Wikiadmin on 2026-07-29.

You can add HTML meta tags to every page in an MDriven Turnkey application by placing an override file in your application's AssetsTK folder.

Add extra meta tags

Turnkey looks for the following file in the AssetsTK strategy folder:

<YourModelFileName>_AssetsTK/Views/EXT_OverridePages/__ExtraMetaTags.cshtml

For example, if your model file is named MyApplication, create:

MyApplication_AssetsTK/Views/EXT_OverridePages/__ExtraMetaTags.cshtml

When Turnkey finds this file, it reads its contents and injects them after the standard meta tags in the generated page.

Procedure

  1. Locate the <YourModelFileName>_AssetsTK folder used by your Turnkey application.
  2. Create the folder structure Views/EXT_OverridePages if it does not already exist.
  3. Create a file named __ExtraMetaTags.cshtml in that folder.
  4. Add the meta tag or tags you want Turnkey to include.
  5. Deploy or otherwise make the AssetsTK file available with the application according to your AssetsTK strategy.
  6. Load a Turnkey page and inspect the generated HTML <head> to verify that the tags occur after Turnkey's standard meta tags.

Examples

Ask robots not to index pages

Add the following to __ExtraMetaTags.cshtml to request that robots do not index the page:

<meta name="robots" content="noindex">

Set a Content Security Policy

A Content Security Policy (CSP) controls which sources the browser may use for page resources. For example, this policy permits content only from the same origin:

<meta http-equiv="Content-Security-Policy" content="default-src 'self'">

This policy also blocks inline scripts and inline styles. Blocking inline scripts can be acceptable because standard Turnkey does not depend on them. Blocking inline styles is more disruptive: Bootstrap and AngularJS need to change styles dynamically through DOM manipulation.

If Turnkey pages need inline styles, use a policy that explicitly allows them while keeping the default source restricted to the same origin:

<meta http-equiv="Content-Security-Policy" content="style-src 'unsafe-inline' 'self'; default-src 'self'">
Meta tag Result
<meta name="robots" content="noindex"> Requests that robots do not index the page.
default-src 'self' Restricts default resource loading to the same origin and blocks inline scripts and styles.
style-src 'unsafe-inline' 'self'; default-src 'self' Restricts default resource loading to the same origin while permitting inline styles required by Bootstrap and AngularJS behavior.

Content Security Policy considerations

Test a CSP against the full Turnkey user interface before using it in production. A policy that is too restrictive can prevent the browser from applying dynamically changed styles and can break the visual behavior of the application.

Keep the override focused on tags intended for the HTML document head. For UI-specific markup and presentation changes, use the appropriate Turnkey override mechanism instead; TagExpander is documented for ViewModel-oriented UI expansion.

See also