La {{collapse|folding text}}
plantilla se utiliza para colocar cuadros de contracción alrededor de discusiones breves y fragmentos de discusiones. Para plegar hilos de discusión largos , utilice . Hay casos en los que estas plantillas no funcionarán. Consulte Ayuda:Contracción para ver otras opciones.{{Collapse top}}
... lots of text ...
{{Collapse bottom}}
Esta plantilla solo debe usarse de acuerdo con las pautas de Wikipedia:refactoring discussion pages ; nunca debe usarse para finalizar una discusión a pesar de las objeciones de otros editores, excepto en casos de edición disruptiva inequívoca.
No oculte contenido en los artículos. Esto viola las pautas de accesibilidad y listas de desplazamiento y contenido plegable del Manual de estilo de WP .
{{Collapse|1=Discussion text to be put into box.|2=Optional custom heading}}
Definitivamente es más seguro utilizar los parámetros con nombre |1=
y |2=
, porque de lo contrario cualquier carácter "=" romperá la plantilla.
Para compatibilidad con varias plantillas de encuadre y cierre de discusión y de envoltura de discusión, |1=
también se puede dar como |content=
o |text=
, y |2=
también se puede dar como |title=
, |reason=
, |header=
, |heading=
o |result=
.
Esto funciona con listas con viñetas contraídas (la primera viñeta se verá correcta): {{Collapse|title=|Bulleted list}}
comience la lista con viñetas en una nueva línea.
Si descubre que la plantilla no funciona correctamente en una circunstancia particular, lo más probable es que se deba a que el marcado de la tabla wikicode ( {|
, etc.) solo funciona cuando está al comienzo de una nueva línea.
Una solución alternativa para esto es la <table>
variante "HTML puro" ( , etc.) de esta plantilla, , que es idéntica (mismos parámetros, etc.) salvo que no utiliza wikimarkup para el código de la tabla de diseño.{{Collapse/HTML}}
El bg
parámetro es opcional. Cambia el color de fondo. Utilice valores de color web (por ejemplo, #F0F2F5
).
{{Collapse|1=Discussion text to be put into box.|bg=#F0F2F5}}
crea:
El padding
parámetro ajusta la cantidad de relleno de celda (predeterminado a 8px
):
{{Collapse|1=Discussion text to be put into box.|padding=20px}}
crea lo siguiente (expande el cuadro para ver el efecto de relleno del borde):
El float
parámetro permite que el contenido contraído flote hacia la izquierda, la derecha o el centro de la página (el valor predeterminado es none
con width = 100%
):
{{Collapse|1=Discussion text to be put into box.|float=center}}
crea lo siguiente:
{{Collapse|1=Discussion text to be put into box.|float=center|width=30em}}
crea lo siguiente:
{{Collapse|1=Discussion text to be put into box.|float=left|width=30em}}
crea lo siguiente:
{{Collapse|1=Discussion text to be put into box.|float=right|width=30em}}
crea lo siguiente:
{{Collapse|1=Discussion text to be put into box.|float=none|width=30em}}
crea lo siguiente:
Cuando se utiliza con una sección de texto, incluya el encabezado de la sección en la parte contraída del texto. Por ejemplo, dado:
Reemplazar con:
{{subst:Collapse|1= Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.|2= Encabezado }}
Simplemente agréguelo |expand=yes
para que el cuadro aparezca en forma expandida con un enlace "ocultar", en lugar de en forma contraída con un enlace "mostrar". Otras opciones: |expand=
yes, y, expand, expanded, uncollapse, uncollapsed
. Nota: |expand=no
plegará el cuadro (predeterminado).
En algunas situaciones, es posible que no desee que se aplique el clear: both;
CSS predeterminado, que coloca el cuadro de contracción debajo de cualquier contenido flotante a la izquierda o a la derecha dentro del mismo bloque HTML. En este caso, puede usar |clear=none
, |clear=right
o |clear=left
, según sea necesario.
Esta plantilla falla con frecuencia cuando se utiliza con contenido que consiste en o incluye wikitables . Este tipo de contenido se puede contraer utilizando las plantillas y en lugar de . {{collapse top}}
{{collapse bottom}}
{{collapse}}
Si desea contraer solo la tabla y no el resto del contenido, puede hacerlo mediante los parámetros de la tabla wiki. Consulte la guía Contraer tablas para obtener ayuda.
Datos de plantilla para contraer
Crea un cuadro plegable que permite ocultar o revelar su contenido según las órdenes del usuario. Se utiliza para reducir el desorden.
Esta plantilla depende del uso de las tres clases mw-collapsible
, mw-uncollapsed
y mw-collapsed
, que son parte de las versiones de MediaWiki ≥ 1.18. Para los wikis que usan estas versiones de MediaWiki, esta plantilla puede simplemente exportarse y luego importarse en otra instalación de MediaWiki. Esta plantilla incluye {{ main other }} y {{ lorem ipsum }} , que también deben importarse al mismo tiempo. Se deberán realizar algunos cambios en el código fuente para que esta plantilla se pueda usar en el espacio de nombres Main/Article (ns:0).
El texto de alternancia se puede editar en las páginas MediaWiki:Collapsible-expand y MediaWiki:Collapsible-collapse de Wikis externos . Más información en el módulo jquery.makeCollapsible.