Mobile formats templates

Modify the mobile format templates

The mobile format page does not look like the original content item page. To modify the look of the mobile format page, you need to modify its Layout and Content item templates. The templates are located in the File System under ~/MVC/Views/<Format name>/

There are two kind of templates – Layout and Content item templates.
Layout templates can be shared across all content types and are suitable for common parts in the UI such as the logo, header, navigation bar, footer section, etc. Content item templates are specific per content type and are designed to define the look of a single content item of the given content type.

The names of the templates must be in the following format:

  • Layout templates – Layout.<Template name>.chtml
    For example, Layout.Default.cshtml
  • Content item templates – <ModuleName>.<ContentTypeName>.<Template name>.chtml
    For example, News.NewsItem.Default.cshtml

IMPORTANT: When modifying the templates, you must follow the rules and restrictions of the Mobile format - Google AMP.

Create new mobile format template

You can create your custom templates to use different templates across different sites.
To create and configure your custom template, perform the following:

  1. Navigate to ~/MVC/Views/<Format name>/ directory
  2. Create a file with one of the following file names:
    • Layout.<Template name>.chtml for Layout templates
    • <ModuleName>.<ContentTypeName>.<Template name>.chtml for Content item templates
  3. Enter the content of the templates and save the file.
  4. Login to Sitefinity CMS backend as Administrator
  5. Navigate to Administration » Settings » Global settings » Mobile formats
  6. Select your content type.
  7. In the corresponding dropdown box, select your template.
  8. Click Done.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?