Difference between revisions of "Template:Infobox:Header"

From Cantr II Wiki
Jump to: navigation, search
(Modified the behavior of the image.)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
<table style="background-color: #F9F9F9; font-size: 95%; margin:0 0 0 0;" cellpadding="0px" border="0px" cellspacing="0px"><tr><th style="background-color:#<!-- Color de fondo del titulo -->{{{color|FFFFFF}}}; font-size: larger; width:<!-- Ancho de la cabecera -->{{{ancho|250}}}px;"><!-- Titulo -->{{{titulo|ERROR TITULO CABECERA}}}</th></tr><!-- Inclusion de la imagen -->{{if|test={{{imagen|}}}|then=
+
<includeonly><table style="background-color: #F9F9F9; font-size: 95%; margin:0 0 0 0; width:100%;" cellpadding="0px" border="0px" cellspacing="0px"><tr><th style="background-color:#<!-- Title background color -->{{if|test={{{color|}}}|then={{{color}}}|else=FFFFFF}}; font-size: larger;"><!-- Title -->{{{title|ERROR HEADER TITLE}}}</th></tr><!-- Inclusion of the image -->{{if|test={{{image|}}}|then=
<tr><td style="padding:4px 0 0 0"><!-- Imagen y comentario de la imagen -->[[Image:{{{imagen|ERROR IMAGEN}}}|{{{ancho|250}}}px]]{{if|test={{{comentario|}}}|then=<br>{{{comentario|ERROR COMENTARIO}}}|else=}}</td></tr>|else=}}<!-- Inclusion de contenido adicional -->{{if|test={{{contenido|}}}|then=
+
<tr><td style="padding:4px 0 0 0"><!-- Image and commentary -->[[Image:{{{image|IMAGE ERROR}}}|{{if|test={{{resize|}}}|then={{{resize}}}|else={{if|test={{{width|}}}|then={{{width}}}|else=250}}}}px]]{{if|test={{{comment|}}}|then=<br>{{{comment|COMMENT ERROR}}}|else=}}</td></tr>|else=}}<!-- Inclusion of additional content -->{{if|test={{{content|}}}|then=
<tr><td>{{{contenido|ERROR CONTENIDO CABECERA}}}</td></tr>|else=}}</table><noinclude>[[Category:Meta-Plantillas|{{PAGENAME}}]]
+
<tr><td>{{{content|HEADER CONTENT ERROR}}}</td></tr>|else=}}</table></includeonly><noinclude>{{Doc}}[[Category:Meta-Templates|!{{PAGENAME}}]]
 
</noinclude>
 
</noinclude>

Latest revision as of 14:34, 11 December 2010

Template documentation[ view ] [ discuss ] [edit]

{{Infobox:Header}} is a meta-template, ie a template for creating templates. This template is intended to be used in line with the template Template:Infobox:Base.

With this template you can create a table containing a title, an image with commentary and some additional content. You can set the background color for the title and the width of the image.

Usage

Put the following code in the template being designed. Complete the parameters you want, delete the unused.

{{Infobox:Header
| color   = 
| width   = 
| title   = 
| image   = 
| resize  = 
| comment = 
| content = 
}}

Parameters

  • color - Background color of table title in hexacecimal without the "#". The default is "FFFFFF" (white).
  • width - Image width (in pixels). The default is 250.
  • title - The title of the table. This parameter is required.
  • image - Image to be displayed. It is important to describe both the name and the file extension. Note that some images will make the table look extremely long. Avoid this kind of images, or use the resize parameter to resize the image, if posible.
  • resize - This parameter can be used to resize the image. Values are expressed in pixels. Options:
    • Change width: resize = 100
    • Change width and height: resize = 100x50
    • Original size: resize = 0

Even if width and height are specified the image will keep its original aspect ratio: either the width or the height will be equal to the specified maximum, whichever allows the other to be <= the maximum.

  • comment - Comment that describes the image. If a picture was detailed, the comment appears beneath it. Otherwise, the comment is not showing.
  • content - This parameter can be used to add additional content to the table.

You can complete the parameter content including other templates, such as Template:Infobox:Section and Template:Infobox:SectionList. But do not include other template Template:Infobox:Header in this parameter. This template is intended only to lead the table.

Examples

Copy and paste on a page to see the results.

{{Infobox:Base
| width   = 200
| content = {{Infobox:Header
| color   = B8DB82
| width   = 200
| title   = Image of a basil
| image   = Albahaca basil.jpg
| comment = Fresh basil leaves.
}}}}
{{Infobox:Base
| width   = 250
| content = {{Infobox:Header
| color   = ECBA71
| title   = Table without image, just a title
| comment = This comment is not showing.
}}}}

See also