01434: Create a way to choose different templates within a skin

Summary: Create a way to choose different templates within a skin
Created: 2018-10-24 15:21
Status: Closed
Category: Feature
From: CarlosAB
Assigned:
Priority: 1
Version: 2.2.109
OS: lamp

Description: Sometimes when doing a skin for a whole site, one needs different templates for each section, instead of a new skin.

As parts of new templates will be inherited from the original one, mostly css, but most of all the html markup will be changed.

Also the skin will be distributed as one package, with different templates in it, that fit a particular purpose and or layout.

You can different templates for all this purposes / layouts:

  • card layout template for front page
  • special layout template for knowledge base
  • special layout template for forum (fox recipe)
  • special layout template for 1,2,3 columns, that can be used in different places
  • special layout template for AMP
  • special layout template for mobile
  • special layout template for other languages or for the use of css rtl

This also helps google see that your site has different sections and layout arragements.

We have $ActionSkin that changes templates depending on the $action, perhaps we could have a $SkinTemplate to choose which template we want for a group.

CarlosAB October 24, 2018, at 03:22 PM

A skin can supply a skin.php file which can have variables and custom markup, see for example Triad and Choice. A skin can check for a global variable and load specific template with the function LoadPageTemplate() or styles with $HTMLStylesFmt or $HTMLHeaderFmt. See a brief explanation at SkinTemplates. --Petko October 24, 2018, at 04:19 PM

Okay, good thinking, by this time I was supposed to know about LoadPageTemplate(), thanks Petko. CarlosAB October 24, 2018, at 05:23 PM