Difference between revisions of "Template:Description"

From Wikispooks
Jump to navigation Jump to search
(use space better)
(Replace #substring:)
 
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>[[category:Semantic Templates]]This semantic template is for page descriptions. Unlike the other semantic data templates, as well as adding the property it also produces a visual output (as long as the TEXT parameter is non-empty), displaying it in a centered block of italic text with gold border and light gold background. It has just the one parameter which is the description (500 characters or less).<br/> ''It is for use by other templates rather than directly in pages.''<br/>
+
<noinclude>[[category:Semantic Templates]]This semantic template is for page descriptions. Unlike the other semantic data templates, as well as adding the property it also produces a visual output (as long as the TEXT parameter is non-empty), displaying it in a left-justified block of italic text with gold border and light gold background. It has just the one parameter which is the description (500 characters or less). If the description is 500 characters or longer, the excess is displayed in red, and the page is assigned to [[:Category:Pages with overlong descriptions]]<br/> ''It is for use by other templates rather than directly in pages.''<br/>
 
Usage:
 
Usage:
:<Code><nowiki>{{Description|TEXT}}</nowiki></code>
+
:<code><nowiki>{{Description|TEXT}}</nowiki></code>
 
The result will be as shown below with your text replacing the curly-braced parameter.
 
The result will be as shown below with your text replacing the curly-braced parameter.
</noinclude>{{#if: {{{1|}}}|<div align="center">  
+
</noinclude><includeonly>{{#ifeq: {{#invoke:String|len|{{{1|}}}}}|0|[[Category:Undescribed Pages]]|<div align="left">  
{{{!}}style="width:95%; font-style:italic; text-align:left; background-color:ivory; border:1pt solid darkgoldenrod; padding:0.1em 0.5em; font-size:105%;"
+
{{{!}}style="width:70%; font-style:italic; text-align:left; background-color:ivory; border:1pt solid darkgoldenrod; padding:0.1em 0.5em; font-size:106%;"
 
{{!}}-
 
{{!}}-
{{!}}[[Description::{{{1}}}]]
+
{{!}}{{#ifexpr: {{#invoke:String|len| {{{1|}}}}}<501|[[Description::{{{1}}}]]|{{#sub: {{{1}}}|0|500}}{{RED|{{#sub: {{{1}}}|500}}}}[[Description::{{#sub: {{{1}}}|0|497}}...]][[Category:Pages with overlong descriptions]]}}
{{!}}}<br/></div>}}
+
{{!}}}<br/></div>}}</includeonly>

Latest revision as of 06:06, 6 July 2019

This semantic template is for page descriptions. Unlike the other semantic data templates, as well as adding the property it also produces a visual output (as long as the TEXT parameter is non-empty), displaying it in a left-justified block of italic text with gold border and light gold background. It has just the one parameter which is the description (500 characters or less). If the description is 500 characters or longer, the excess is displayed in red, and the page is assigned to Category:Pages with overlong descriptions
It is for use by other templates rather than directly in pages.
Usage:

{{Description|TEXT}}

The result will be as shown below with your text replacing the curly-braced parameter.