(Imported by WSPageSync)
(Imported by PageSync)
Tag: Metadata slot edit
 
Line 1: Line 1:
<noinclude>{{Managed
+
<noinclude>
|Version=1.2
 
|Version notes=1.2 - Added "Pagetitle format"
 
1.1 - Moved functionality from separate "Layout settings", "Storage templates" and "Sidebar templates" templates into this one.
 
1.0 - First managed version
 
|Short description=
 
}}
 
 
 
 
This is the "Class definition" template. It should be called in the following format:
 
This is the "Class definition" template. It should be called in the following format:
  
 
<pre>
 
<pre>
 
{{Class definition
 
{{Class definition
|Defines class= <text> value that is used for Class property in content pages of this type
+
|Defines class= (text) value that is used for Class property in content pages of this type
|Pagetitle format= <value options: title, next_available> the wscreate in "Template:Create page form" will be based on this option, default "next_available"
+
|Pagetitle format= (value options: title, next_available) the wscreate in "Template:Create page form" will be based on this option, default "next_available"
|Allowed namespaces= <optional: comma-separted namespaces> namespaces in which pages of this class are allowed to be created, e.g. "(Main), Project, Article"
+
|Allowed namespaces= (optional: comma-separted namespaces) namespaces in which pages of this class are allowed to be created, e.g. "(Main), Project, Article"
|Short description= <optional: text>
+
|Short description= (optional: text)
 +
|Has version history= (optional: true) if true, then {{Show version history}} will be added to generated sidebar template code
  
 
layout settings (used to order chameleon components)
 
layout settings (used to order chameleon components)
|Areas= <components> for example 'sidebar main'. Base csp components are: sidebar, sub-header, main
+
|Areas= (components) for example 'sidebar main'. Base csp components are: sidebar, sub-header, main
|Columns= <size attribute of components> for example: 15em 2fr
+
|Columns= (size attribute of components) for example: 15em 2fr
 
|Rows=
 
|Rows=
  
 
storage templates
 
storage templates
|Base properties template= <optional: page> default "Template:Base properties"
+
|Base properties template= (optional: page) default "Template:Base properties"
|Page properties template <optional: page> default "Template:{{{Defines class|}}} properties"
+
|Page properties template (optional: page) default "Template:{{{Defines class|}}} properties"
  
 
component templates
 
component templates
|Sidebar template= <optional: page> default "Template:{{{Defines class|}}} sidebar"
+
|Sidebar template= (optional: page) default "Template:{{{Defines class|}}} sidebar"
|Sidebar form= <optional: page> no default
+
|Sidebar form= (optional: page) no default
|Sub header template= <optional: page> no default
+
|Sub header template= (optional: page) no default
  
 
|Parameters= (multiple instance template)
 
|Parameters= (multiple instance template)
}}
+
{{Parameter definition  
{{Parameter definition  
 
 
|...
 
|...
 
|...
 
|...
Line 39: Line 32:
 
|...
 
|...
 
}}
 
}}
 +
 
}}
 
}}
 
</pre>
 
</pre>
Line 118: Line 112:
 
<ul>{{#caamap:{{{Allowed namespaces|}}} |,|@@|<li>@@</li>|}}</ul>
 
<ul>{{#caamap:{{{Allowed namespaces|}}} |,|@@|<li>@@</li>|}}</ul>
 
}}<!--
 
}}<!--
-->{{#if:{{{Short description|}}}|<p>{{{Short description|}}}</p> }}
+
-->{{#if:{{{Short description|}}}|<p>{{{Short description|}}}</p> }}<!--
 +
--><p>Has version history: {{#ifeq:{{{Has version history|}}} |true |'''true''' |false}}</p>
  
 
<h2>Layout</h2>
 
<h2>Layout</h2>
Line 171: Line 166:
  
 
{{Generate page properties template code |Class={{{Defines class|}}} }}</div>
 
{{Generate page properties template code |Class={{{Defines class|}}} }}</div>
<div class="tab-pane fade" id="template-code-sidebar" >[[{{#var:@sidebar-template}}]] {{Generate sidebar template code |Class={{{Defines class|}}} }}</div>
+
<div class="tab-pane fade" id="template-code-sidebar" >[[{{#var:@sidebar-template}}]] {{Generate sidebar template code |Class={{{Defines class|}}} |Has version history={{{Has version history|}}} }}</div>
 
</div>
 
</div>
  
 
</includeonly>
 
</includeonly>
ws-base-props
Line 1: Line 1:
 
+
{{Base properties
 +
|Class=Application page
 +
|Title=Template:Class definition
 +
|Version history={{Version history item
 +
|Version number=1.0
 +
|Version description=Initial version
 +
|Version date=2022-12-02 09:02:38
 +
}}
 +
}}
ws-class-props
Line 1: Line 1:
 
+
{{Application page properties
 +
|Type=CSP Basis Core
 +
|Origin=CSP Basis
 +
}}

Latest revision as of 13:46, 18 January 2023

This is the "Class definition" template. It should be called in the following format:

{{Class definition
|Defines class= (text) value that is used for Class property in content pages of this type
|Pagetitle format= (value options: title, next_available) the wscreate in "Template:Create page form" will be based on this option, default "next_available"
|Allowed namespaces= (optional: comma-separted namespaces) namespaces in which pages of this class are allowed to be created, e.g. "(Main), Project, Article"
|Short description= (optional: text)
|Has version history= (optional: true) if true, then {{Show version history}} will be added to generated sidebar template code

layout settings (used to order chameleon components)
|Areas= (components) for example 'sidebar main'. Base csp components are: sidebar, sub-header, main
|Columns= (size attribute of components) for example: 15em 2fr
|Rows=

storage templates
|Base properties template= (optional: page) default "Template:Base properties"
|Page properties template (optional: page) default "Template:{{{Defines class|}}} properties"

component templates
|Sidebar template= (optional: page) default "Template:{{{Defines class|}}} sidebar"
|Sidebar form= (optional: page) no default
|Sub header template= (optional: page) no default

|Parameters= (multiple instance template)
{{Parameter definition 
|...
|...
}}{{Parameter definition 
|...
|...
}}

}}

Pagetitle formats:

  • title will result in a pagetitle with format Class/title-entered-by-user such as Organization/wikibase-solutions
  • next_available will result in a pagetitle with format Class/incremental_number such as Organization/1 Organization/2 Organization/3 etc.

Different Chameleon components can be ordered for different page classes

  • Base csp components are: sidebar, sub-header, main
  • They are defined in the Chameleon skin XML and the default values are set in layout.css
  • You can define different layouts on the Areas parameter, see grid-template-areas for syntax
  • You can define sizes for the columns and rows for this layout, see grid-template-columns and grid-template-rows for syntax

Example

The example below creates to rows on all pages with the Article class

The first row holds the Sidebar and the Sub-header components the Sidebar is set to be 15em wide and the Sub-header is set to 1 fraction, the hieght of this row is set to Auto

The second row holds the Main content component it spans over two columns the height of this row is set to 1 fraction

{{Class definition
|Defines class=Article

|Areas='sidebar sub-header' 'main main'
|Columns=15em 2fr
|Rows=auto 1fr
}}