DokuWiki

It's better when it's simple

Herramientas de usuario

Herramientas del sitio


es:devel:templates

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anteriorRevisión previa
Próxima revisión
Revisión previa
Última revisiónAmbos lados, revisión siguiente
es:devel:templates [2013-04-28 07:15] polypuses:devel:templates [2013-04-28 09:21] – Translate - Tradución final por polypus polypus
Línea 10: Línea 10:
  
   - Instalar la plantilla Starter   - Instalar la plantilla Starter
-  - Renombre la carpeta ''lib/tpl/starter'' al nombre que usted desee ''lib/tpl/SuNOMBRE''+  - Renombre la carpeta ''lib/tpl/starter'' al nombre que usted desee ''lib/tpl/SuNOMBREdePlantilla''
   - Seleccione la nueva plantilla con el gestor de configuración.   - Seleccione la nueva plantilla con el gestor de configuración.
-  - A continuacion eche un vistazo a los archivos de su plantilla (ver [[#directory layout]] mas abajo)+  - A continuacion eche un vistazo a los archivos de su plantilla (ver [[#estructura de directorios]] mas abajo)
   - Vea que que en [[:DokuWiki]] se maneja un [[devel:css|CSS]] utilizando su [[devel:css|CSS dispatcher]].   - Vea que que en [[:DokuWiki]] se maneja un [[devel:css|CSS]] utilizando su [[devel:css|CSS dispatcher]].
-  - Handling of configuration settings is analogous to [[devel:common_plugin_functions|plugins]]. Use ''%%tpl_getConf(<setting>)%%'' to retrieve custom template settings.+  - El manejo de los ajustes de configuración es análoga a [[devel:common_plugin_functions|plugins]]. Use ''%%tpl_getConf(<setting>)%%'' para recuperar la configuración de las plantillas personalizadas.
  
-===== Directory Layout =====+===== Estructura de Directorios =====
  
-Templates should follow the following directory structure (all paths are relative to the template directory). +Las plantillas deben seguir la siguiente estructura de directorios (las rutas son relativas al directorio de templates). 
  
-CSS files are specified in the ''[[CSS#style.ini]]'' fileUse as many files you'd likebut you should at least provide one CSS file for the screen presentation and one for printing.+Los archivos CSS se especifican en el archivo ''[[devel:css#styleini|style.ini]]''Usa tantos archivos quieraspero debes proporcionar un CSS para las presentaciones en pantalla y otro para la impresión.
  
   * ''<dokuwiki>/lib/tpl/<template>/''   * ''<dokuwiki>/lib/tpl/<template>/''
-    * ''<filename>.css'' +    * ''<nombreDeARCHIVO>.css'' 
-    * ''[[devel:templates:main.php]]'' -- general layout of DokuWiki +    * ''[[devel:templates:main.php]]'' -- Estructura general de DokuWiki 
-    * ''[[devel:templates:detail.php]]'' -- the image detail page +    * ''[[devel:templates:detail.php]]'' -- pagina de detalles de imagen. 
-    * ''[[devel:templates:mediamanager.php]]'' -- the media-selection popup +    * ''[[devel:templates:mediamanager.php]]'' -- popup medios de selección 
-    * ''images/'' -- all images used in the template+    * ''images/'' -- todas las imagenes usadas utilizadas en la pagina.
     * ''conf/''     * ''conf/''
-      * ''default.php'' -- [[configuration#default settings]] (see ''[[#tpl_getConf]]''+      * ''default.php'' -- [[devel:configuration#default_settings|ajustes por defecto]] (see ''[[#tpl_getConf]]''
-      * ''metadata.php'' -- [[configuration#configuration metadata]] (see ''[[#tpl_getConf()]]''+      * ''metadata.php'' -- [[configuration#configuration metadata]] (vea ''[[devel:templates#tpl_getconf|tpl_getConf()]]''
-    * ''lang/'' -- language files +    * ''lang/'' -- archivos para idiomas. 
-      * ''<lang code>/lang.php'' -- localization strings used in the template +      * ''<lang code>/lang.php'' -- cadenas de localización utilizados en la plantilla 
-      * ''<lang code>/settings.php'' -- localization strings used in the configuration manager +      * ''<lang code>/settings.php'' -- cadenas de configuración utilizadas en el gestor de configuración. 
-    * ''style.ini'' -- see [[CSS#Style.ini]] +    * ''style.ini'' -- ver [[devel:css#styleini|style.ini]] 
-    * ''favicon.ico'' -- will be used if none exists in the media-directory (see [[xref>tpl_getFavicon()|tpl_getFavicon()]]) +    * ''favicon.ico'' -- se utilizará si no existe en el directorio de los medio de comunicación (ver [[xref>tpl_getFavicon()|tpl_getFavicon()]]) 
-    * ''template.info.txt'' -- A text file with [[devel:template info|template information]] **required!** +    * ''template.info.txt'' -- Archivo de texto con [[devel:template info|informacion de la plantilla]] **es requerido!**
-===== Functions =====+
  
-A list of available functions can be found in [[xref>inc/template.php|API documentation]]. Some specialties are listed here.+===== Funciones ===== 
 +Lista de funciones que se pueden encontrar en la [[xref>inc/template.php|Documentación API]]. Algunas especiales se enumeran a continuación.
  
-  * **''[[xref>tpl_content()]]''** \\ This function outputs the page bodyor in other words the content of your wiki pageincluding the [[:TOC]]. You can prevent it from outputting the TOC by passing ''false'' while calling it: <code php>+  * **''[[xref>tpl_content()]]''** \\ Esta función permite visualizar el cuerpo de la paginaen otras palabras el contenido de su pagina Wikiinluido el [[:TOC|TDC]]. Puede evitar el TDC cambiando la llamada a "false": <code php>
 tpl_content(false); tpl_content(false);
-</code>This can be used to separate the TOC from the content and place it somewhere else on the screenSee ''tpl_toc()'' below for further details.+</code>Esto se puede utilizar para separar la tabla de contenido y colocarlo en otro lugar de la pantallaVer ''[[xref>tpl_toc()]]'' a continuación para ver más detalles.
  
-  * **''[[xref>tpl_toc()]]''** \\ By defaultthe ''tpl_content()'' function will take care of displaying a [[:TOC|Table of Contents]] itselfprepending it to the actual page contentIf your template uses a sidebar or other more complex layout you may want to place the TOC independently from the page contentThis can be done with the ''tpl_toc()'' functionWhen using itit is important to disable automatic TOC placement by passing the argument ''false'' to the ''tpl_content()'' function.\\ \\ **Example:** \\ <code php>+  * **''[[xref>tpl_toc()]]''** \\ Por defectola funcion ''tpl_content()'' se encargara de mostrar una [[:TOC|tabla de contenidos]] , anteponiendo el contenido real de la páginaSi la plantilla  utiliza una barra lateral u otro diseño más complejo es posible que desee colocar el TDC de forma independiente al contenido de la páginaEsto se puede hacer con la funcion ''tpl_toc()''Al utilizarloes importante desactivar el automatico TDC colocando el argumento en ''false'' en la función ''tpl_content()'' .\\ \\ **Ejemplo:** \\ <code php>
 <div id="content"> <div id="content">
     <?php tpl_content(false)?>     <?php tpl_content(false)?>
Línea 53: Línea 53:
     <?php tpl_toc()?>     <?php tpl_toc()?>
 </div> </div>
-</code>The ''tpl_toc()'' function renders the TOC from three different sourcesglobal [[environment#$TOC]] variablethe page [[metadata]] or the ''getTOC()'' method of [[admin plugins]]. Because there is no metadata available for old revisions or preview ''tpl_toc()'' can only use the global [[environment#$TOC]] variable for these casesBecause the [[environment#$TOC]] variable is filled by the page renderer this will only work when ''tpl_toc()'' is called **after** ''tpl_content()''If this is not possible in your template layout you may use output buffering to circumvent the problem. \\ \\ **Example:**\\ <code php>+</code>La función ''tpl_toc()''  hace que el TDC de tres formas diferentesUn variable global [[devel:environment#toc|$TOC]] , la página [[devel:metadata|metadata]] o el ''getTOC()'' método de [[devel:admin_plugins|administrador de plugins]]. Porque no hay metadatos disponibles para las revisiones antiguas o vista previa de ''tpl_toc()'' solo se puede utilizar la variable global [[devel:environment#toc|$TOC]] para dichos casosDebido a que la variable [[devel:environment#toc|$TOC]]  es llenado por la página renderer esto sólo funcionará cuando ''tpl_toc()'' es llamado **después** ''tpl_content()''Si esto no es posible en su composición de plantilla puede usar búferes de salida para eludir el problema. \\ \\ **Ejemplo:**\\ <code php>
 <?php <?php
-    // render the content into buffer for later use+    // procesar el contenido en el búfer para su uso a posterior
     ob_start();     ob_start();
     tpl_content(false);     tpl_content(false);
Línea 70: Línea 70:
 </code> </code>
  
-  * **''[[xref>tpl_getConf()]]''** \\ This function is used to access [[configuration|configuration settings]] from within the template.+  * **''[[xref>tpl_getConf()]]''** \\ Esta función se utiliza para acceder a la [[devel:configuration|configuación]] desde dentro de la pantilla.
  
-===== Global Variables And Constants ===== +===== Variables globales y constantes ===== 
-For a complete list of useful global variables and constants please refer to the [[environment]] page.+Para ver una lista completa de las variables globales útiles y constantes consulte la pagina de [[devel:environment|entorno]].
  
-===== Automated Housekeeping =====+===== Servisio de limpieza automática =====
  
-Almost at the bottom of the default template'[[devel:templates:main.php]] file you'll see function call to ''tpl_indexerWebBug()''The function generates a HTML ''%%<img>%%'' tag which results in a request to ''[[:indexer|lib/exe/indexer.php]]''This **vital** part of DokuWiki provides important housekeeping work to keep the wiki running smoothlyAll templates should include this functionwithout it the wiki may not function correctly (for example the [[:search|search index]] wont be built).+Casi al final del archivo [[devel:templates:main.php]] de la plantilla por defecto verá una llamada la función ''tpl_indexerWebBug()''La función genera una etiqueta HTML ''%%<img>%%'' que da como resultado una solicitud para ''[[:indexer|lib/exe/indexer.php]]'' Esta parte **vital** de  DokuWiki  proporciona importantes trabajos de limpieza para mantener el wiki funcionando sin problemasATodas las plantillas deben incluir esta funciónsin que la wiki no funcione correctamente (por ejemplo no será construido el [[:search|Indice de Busquedas]] ).
  
-===== 'dokuwiki' class =====+===== Clase 'dokuwiki' =====
  
-A class named ''dokuwiki'' should be added to some content surrounding element (either around everything or at least around ''tpl_content()''in each template'main.php, detail.php and mediamanager.php. This is to make sure that DokuWiki's styles don't interfere with other styles if it gets integrated into an existing site with potentially conflicting CSS.+La clase denominada ''dokuwiki'' debe añadirse a algún elemento que rodea contenido (ya sea alrededor de todo o al menos alrededor de ''tpl_content ()''en main.php, detail.php mediamanager.php de cada plantillaEsto es para asegurarse de que los estilos de DokuWiki no interfieran con otros estilos si se integra en un sitio existente potencialmente conflictivos CSS.
  
-===== Include Hooks =====+===== Incluya Ganchos/Hooks =====
  
-Include Hooks are simple way to add some static content to your [[:DokuWiki]] installation without writing your own [[:Template]]. You can use them for adding a standard header or company logo to each page or add disclaimer at the bottom of each page.+Incluye ganchos son una manera simple de añadir algo de contenido estático la instalación de [[:DokuWiki]] sin tener que escribir su propia [[:template|plantilla]]. Usted las puede utilizar para agregar un encabezado estándar o logotipo de la empresa cada página o agregar un descargo de responsabilidad en la parte inferior de cada página.
  
-The DokuWiki'default template looks for files with special names in the template directory and simply includes them at the correct places when displaying the pageYou can add whatever HTML you like into these filesOf course this only works if you are using the //default// template or template supporting the same include hooks (like the starter template).+Plantilla predeterminada del DocuWiki'busca archivos con nombres especiales en el directorio de plantillas y simplemente en los lugares correctos incluye al visualizar la páginaPuede añadir cualquier código HTML que desea en estos archivosPor supuesto, esto sólo funciona si está usando la plantilla por //defecto// o una plantilla de apoyo la misma que incluya Hooks (como la Starter Template).
  
-__Hint for PHP developers:__ You may be happy to hear that you can even include PHP in these files.+__Sugerencia para los desarrolladores de PHP:__ Usted puede ser feliz de saber que incluso se puede incluir PHP en estos archivos.
  
-==== Available Hooks ====+==== Hooks Disponibles ====
  
-All these files are searched for in the ''lib/tpl/default/'' directory.+Todos estos archivos se buscan en el directorio  ''lib/tpl/default/'' .
  
 ^ Filename        ^ Position of included HTML                                                ^ ^ Filename        ^ Position of included HTML                                                ^
-| ''meta.html''       Inside the HTML <head>, use this to add additional styles or metaheaders | +| ''meta.html''       Dentro de la <head> HTMLutilice esta opción para agregar estilos o metaheaders adicionales 
-| ''topheader.html'' At the very top of the page right after the <body> tag +| ''topheader.html'' En la parte superior de la página de la derecha después de la etiqueta <body>
-| ''header.html''     Above the upper blue barbelow the pagename and wiki title +| ''header.html''     Por encima de la barra azul superiordebajo del título y el nombre de la página wiki | 
-| ''pageheader.html''Below the breadcrumbs, above the actual content +| ''pageheader.html''A continuación el breadcrumbs, por encima del contenido real 
-| ''pagefooter.html''Above the lower blue barbelow the last changed Date +| ''pagefooter.html''Por encima de la barra azul inferiordebajo de la última cambiado Fecha 
-| ''footer.html''     At the very end of the page just before the </body> tag |+| ''footer.html''     Al final de la página justo antes de la etiqueta </ body> |
  
-DokuWiki comes with an example ''footer.html'' containing some buttons and a CC license RDF description.+DokuWiki viene con un ejemplo ''footer.html'' contiene algunos botones y una licencia CC descripción RDF.
  
 See also [[:include hooks]] for the user explanation. See also [[:include hooks]] for the user explanation.
es/devel/templates.txt · Última modificación: 2014-07-21 10:57 por 82.158.57.250

Excepto donde se indique lo contrario, el contenido de este wiki esta bajo la siguiente licencia: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki