<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="ARTICLE @ XOOPS powered by FeedCreator" -->
<rss version="0.91">
    <channel>
        <title>Xoops Italia :: Articolo</title>
        <description><![CDATA[Articolo XML]]></description>
        <link>http://www.xoopsitalia.org/modules/article/view.article.php/63/c8</link>
        <lastBuildDate>Tue, 13 May 2008 00:17:48 +0200</lastBuildDate>
        <generator>ARTICLE @ XOOPS powered by FeedCreator</generator>
        <image>
            <url>http://www.xoopsitalia.org/modules/article/images/logo.png</url>
            <title>Xoops Italia :: Articolo</title>
            <link>http://www.xoopsitalia.org/modules/article/</link>
            <width>80</width>
            <height>15</height>
            <description>Articolo XML</description>
        </image>
        <language>it</language>
        <managingEditor>defkon1 at gmail dot com</managingEditor>
        <webMaster>defkon1 at gmail dot com</webMaster>
        <category>Tutorial Avanzati</category>
        <item>
            <title>Override di un template: tutorial introduttivo</title>
            <link>http://www.xoopsitalia.org/modules/article/view.article.php/63/c8</link>
            <description><![CDATA[Categoria: Temi e templates<br />Sorgente: (http://www.xoops.org/modules/news/article.php?storyid=3367)<br />Sommario: Questo articolo, spiega il concetto di <b>override</b> (sovrascrittura) <b>di un Template</b>, una caratteristica introdotta in XOOPS 2.0.14.<br />E' stato realizzato per aiutare gli utenti a capire questo nuovo concetto tramite una serie di esempi.<strong><a name="heading1" id="heading1"></a><h3>1) Che cos'è un template</h3></strong><br />Prima di tutto, cos'è un template?<br />I template possono visualizzare dati (come possono allo stesso modo ordinarli, posizionarli, e visualizzarli condizionatamente...).<br />I template sono usati per separare il processo di visualizzazione dati da quello di recupero e manipolazione.<br />Questo consente a quanti non sono programmatori di formattare facilmente i dati per la presentazione, senza modificare il codice sottostante, semplicemente modificando il file del template.<br /><br />XOOPS ha di base dei template (quelli del modulo system sono 26 file), per esempio:<br />- system_redirect.html (Pagina di reindirizzamento)<br />- system_siteclosed.html (Pagina sito chiuso)<br />- system_block_login.html (Blocco di login)<br />- system_block_online.html (Blocco utenti online)<br />- system_block_comments.html (Blocco commenti)...<br />Inoltre tutti i moduli recenti usano template (pagine e blocchi).<br /><br />Esempio:<br />Modulo News (15 template):<br />- news_archive.html (pagina archivio)<br />- news_block_new.html (blocco nuove notizie)<br />- news_block_top.html (blocco notizie più lette)...<br /><br />Per visualizzare questi template, vai a admin -> system -> templates e clicca nella lista del modulo che vuoi vedere, nell'insieme dei template di default.<br />La sezione superiore mostra la pagina dei template, con i template dei blocchi nella parte inferiore.<br /><br />Se queste pagine e blocchi non sono visualizzate nei tuoi link, non è un problema, puoi modificarli con la nuova funzionalità inclusa nel core dalla versione XOOPS 2.0.14:<br />Overriding dei template.<br /><br />Un estratto dall'annuncio di rilascio di XOOPS 2.0.14:<br />Citazione:<div class="xoopsQuote"><blockquote>I progettisti possono aggiungere template ai loro temi, e questi saranno usati al posto di quelli di default.<br />Per sfruttare questa caratteristica, i template devono essere creati in sottocartelle dei temi duplicando la struttura delle cartelle e rimuovendo la sezione "templates":<br />Per sovrascrivere:<br />system_userinfo.html (template che si trova in modules/system/templates/system_userinfo.html), devi creare la tua versione personalizzata in:<br /><cartella_tuotema>/modules/system/system_userinfo.html<br /><br />Per sovrascrivere:<br />system_block_login.html (template che si trova in modules/system/templates/blocks/system_block_login.html), devi creare la tua versione personalizzata in:<br /><cartella_tuotema>/modules/system/blocks/system_block_login.html</blockquote></div><br /><br /><strong><a name="heading2" id="heading2"></a><h3>2) Il concetto di Override</h3></strong><br />Ora, non c'è più bisogno di clonare il tuo template set di default, puoi continuare ad usarlo (infatti, per l'override, <strong>DEVI</strong> utilizzarlo), <br />sarà sufficiente creare una copia del template orginale de modulo nella directory themes/<tuotema>/modules/<nomemodulo>.<br /><br /><strong>Vantaggi:</strong><br />- Nel caso di "Aggiornamento" del modulo, i file modificati non devono essere cancellati<br />- Solo i template modificati saranno presenti nella directory <cartella_tuotema><br />- La traccia delle personalizzazioni dei template è ora molto semplice (struttura dei file)<br />- Facile da usare<br />- Puoi cambiare temi molto facilmente sovrascrivendo il pacchetto dei template di default (per esempio, blocco di login, blocco di ricerca, blocco sito chiuso...)<br /><br /><strong><a name="heading3" id="heading3"></a><h3>3) Esempio pratico #1</h3></strong><br />Personalizzazione del template "blocco commenti" (system_block_comments.html del modulo system)<br /><br /><strong>0a)</strong> Verifica le modifiche nel tuo server di test prima di effettuare cambiamenti in produzione.<br /><strong>0b)</strong> Devi utilizzare una versione di XOOPS 2.0.14 o superiore, (o la versione 2.3.x)<br /><strong>0c)</strong> Se stai utilizzando un insieme di template clonati, devi attivare il template set default per poter usare l'Overriding.<br />In questo caso, puoi scaricare i template personalizzati dal tuo set clonato in modo da spostarli nella cartella appropriata per l'overriding.<br /><strong>0d)</strong> Il tuo blocco deve essere visibile per vedere le modifiche al template! <img src="http://www.xoopsitalia.org/uploads/smil44ec2347b7c85.gif" alt="" /> (per i nuovi utenti)<br /><br /><strong>1)</strong> Prima di tutto esegui il download del template del blocco:<br />admin system / templates / elenco System / linea system_block_comments.html, [Download]/i]<br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">table&nbsp;width</span><span style="color: #007700">=</span><span style="color: #DD0000">"100%"&nbsp;</span><span style="color: #0000BB">cellspacing</span><span style="color: #007700">=</span><span style="color: #DD0000">"1"&nbsp;</span><span style="color: #007700">class=</span><span style="color: #DD0000">"outer"</span><span style="color: #007700">&gt;<br />&nbsp;&lt;{foreach&nbsp;</span><span style="color: #0000BB">item</span><span style="color: #007700">=</span><span style="color: #0000BB">comment&nbsp;from</span><span style="color: #007700">=</span><span style="color: #0000BB">$block</span><span style="color: #007700">.</span><span style="color: #0000BB">comments</span><span style="color: #007700">}&gt;<br />&nbsp;&lt;</span><span style="color: #0000BB">tr&nbsp;</span><span style="color: #007700">class=</span><span style="color: #DD0000">"&lt;{cycle&nbsp;values="</span><span style="color: #0000BB">even</span><span style="color: #007700">,</span><span style="color: #0000BB">odd</span><span style="color: #DD0000">"}&gt;"</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">td&nbsp;align</span><span style="color: #007700">=</span><span style="color: #DD0000">"center"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">img&nbsp;src</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{$xoops_url}&gt;/images/subject/&lt;{$comment.icon}&gt;"&nbsp;</span><span style="color: #0000BB">alt</span><span style="color: #007700">=</span><span style="color: #DD0000">""&nbsp;</span><span style="color: #007700">/&gt;&lt;/</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;&lt;{</span><span style="color: #0000BB">$comment</span><span style="color: #007700">.</span><span style="color: #0000BB">title</span><span style="color: #007700">}&gt;&lt;/</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">td&nbsp;align</span><span style="color: #007700">=</span><span style="color: #DD0000">"center"</span><span style="color: #007700">&gt;&lt;{</span><span style="color: #0000BB">$comment</span><span style="color: #007700">.</span><span style="color: #0000BB">module</span><span style="color: #007700">}&gt;&lt;/</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">td&nbsp;align</span><span style="color: #007700">=</span><span style="color: #DD0000">"center"</span><span style="color: #007700">&gt;&lt;{</span><span style="color: #0000BB">$comment</span><span style="color: #007700">.</span><span style="color: #0000BB">poster</span><span style="color: #007700">}&gt;&lt;/</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">td&nbsp;align</span><span style="color: #007700">=</span><span style="color: #DD0000">"right"</span><span style="color: #007700">&gt;&lt;{</span><span style="color: #0000BB">$comment</span><span style="color: #007700">.</span><span style="color: #0000BB">time</span><span style="color: #007700">}&gt;&lt;/</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;<br />&nbsp;&lt;/</span><span style="color: #0000BB">tr</span><span style="color: #007700">&gt;<br />&nbsp;&lt;{/foreach}&gt;<br />&lt;/</span><span style="color: #0000BB">table</span><span style="color: #007700">&gt;</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br /><br /><strong>2)</strong> Modifica il file appena scaricato e che ora è in locale.<br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">table&nbsp;width</span><span style="color: #007700">=</span><span style="color: #DD0000">"100%"&nbsp;</span><span style="color: #0000BB">cellspacing</span><span style="color: #007700">=</span><span style="color: #DD0000">"1"&nbsp;</span><span style="color: #007700">class=</span><span style="color: #DD0000">"outer"</span><span style="color: #007700">&gt;<br />&nbsp;&lt;{foreach&nbsp;</span><span style="color: #0000BB">item</span><span style="color: #007700">=</span><span style="color: #0000BB">comment&nbsp;from</span><span style="color: #007700">=</span><span style="color: #0000BB">$block</span><span style="color: #007700">.</span><span style="color: #0000BB">comments</span><span style="color: #007700">}&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">tr&nbsp;</span><span style="color: #007700">class=</span><span style="color: #DD0000">"&lt;{cycle&nbsp;values="</span><span style="color: #0000BB">even</span><span style="color: #007700">,</span><span style="color: #0000BB">odd</span><span style="color: #DD0000">"}&gt;"</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">td&nbsp;style</span><span style="color: #007700">=</span><span style="color: #DD0000">"text-align:&nbsp;left;&nbsp;vertical-align:&nbsp;middle;"</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">img&nbsp;src</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{$xoops_url}&gt;/images/commentaires_ico_16.gif"&nbsp;</span><span style="color: #0000BB">alt</span><span style="color: #007700">=</span><span style="color: #DD0000">"Commentaire"&nbsp;</span><span style="color: #007700">/&gt;&nbsp;&lt;{</span><span style="color: #0000BB">$comment</span><span style="color: #007700">.</span><span style="color: #0000BB">title</span><span style="color: #007700">}&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">div&nbsp;style</span><span style="color: #007700">=</span><span style="color: #DD0000">"text-align:right"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">br&nbsp;</span><span style="color: #007700">/&gt;&lt;{</span><span style="color: #0000BB">$comment</span><span style="color: #007700">.</span><span style="color: #0000BB">module</span><span style="color: #007700">}&gt;&nbsp;-&nbsp;&lt;{</span><span style="color: #0000BB">$comment</span><span style="color: #007700">.</span><span style="color: #0000BB">time</span><span style="color: #007700">}&gt;&nbsp;-&nbsp;&lt;{</span><span style="color: #0000BB">$comment</span><span style="color: #007700">.</span><span style="color: #0000BB">poster</span><span style="color: #007700">}&gt;&lt;/</span><span style="color: #0000BB">div</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/</span><span style="color: #0000BB">tr</span><span style="color: #007700">&gt;<br />&nbsp;&lt;{/foreach}&gt;<br />&lt;/</span><span style="color: #0000BB">table</span><span style="color: #007700">&gt;</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br /><br /><strong>3)</strong> Se il mio tema è <a href="http://www.7dana.com/download/pafiledb.php?action=file&id=25" target="_blank">7dana-soft</a>, tramite ftp, vai alla cartella<br />/themes/7dana-soft Crea una cartella 'modules' e poi all'interno crea la cartella 'system' (il nome del modulo di cui si sovrascrive il template) e poi la cartella 'blocks'.<br /><strong>4)</strong> Esegui l'upload del file locale system_block_comments.html in /themes/7dana-soft/modules/system/blocks/ sul server.<br /><strong>5)</strong> Elimina i file nella cartella /template_c (eccetto index.html) (o aggiorniamo la cache del modulo) in modo da visualizzare i risultati dei nostri cambiamenti...<br /><br /><img src="http://www.xoopsitalia.org/uploads/tutorial_img/override/comments_default.jpg" align="left" /><img src="http://www.xoopsitalia.org/uploads/tutorial_img/override/comments_surcharge.jpg" align="right" />                                                                         <br /><== blocco commenti di default<br />blocco personalizzato ==><br style="clear:both;" /><br /><br /><br /><strong><a name="heading4" id="heading4"></a><h3>4) Esempio pratico #2</h3></strong><br />Un altro esempio ma con i "contenuti in attesa" del modulo Blocco Estensibile Contenuti in Attesa.<br /><br /><strong>0a 0b 0c 0d</strong> Gli stessi dell'esempio 1<br /><strong>1)</strong> Prima esegui il download del file blocco template:<br />admin system / templates / Waiting Contents Extensible [i]lista / linea waiting_block_waiting.html, [Download]<br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;{foreach&nbsp;</span><span style="color: #0000BB">item</span><span style="color: #007700">=</span><span style="color: #0000BB">module&nbsp;from</span><span style="color: #007700">=</span><span style="color: #0000BB">$block</span><span style="color: #007700">.</span><span style="color: #0000BB">modules</span><span style="color: #007700">}&gt;<br />&lt;{</span><span style="color: #0000BB">$module</span><span style="color: #007700">.</span><span style="color: #0000BB">name</span><span style="color: #007700">}&gt;<br />&lt;</span><span style="color: #0000BB">ul</span><span style="color: #007700">&gt;<br />&nbsp;&lt;{foreach&nbsp;</span><span style="color: #0000BB">item</span><span style="color: #007700">=</span><span style="color: #0000BB">pending&nbsp;from</span><span style="color: #007700">=</span><span style="color: #0000BB">$module</span><span style="color: #007700">.</span><span style="color: #0000BB">pending</span><span style="color: #007700">}&gt;<br />&nbsp;&lt;</span><span style="color: #0000BB">li</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&lt;{if&nbsp;</span><span style="color: #0000BB">$pending</span><span style="color: #007700">.</span><span style="color: #0000BB">pendingnum</span><span style="color: #007700">}&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">span&nbsp;style</span><span style="color: #007700">=</span><span style="color: #DD0000">'font-weight:bold;'</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&lt;{else}&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">span&nbsp;style</span><span style="color: #007700">=</span><span style="color: #DD0000">'font-weight:normal;'</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&lt;{/if}&gt;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">a&nbsp;href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{$pending.adminlink}&gt;"</span><span style="color: #007700">&gt;&lt;{</span><span style="color: #0000BB">$pending</span><span style="color: #007700">.</span><span style="color: #0000BB">lang_linkname</span><span style="color: #007700">}&gt;&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;:&lt;{</span><span style="color: #0000BB">$pending</span><span style="color: #007700">.</span><span style="color: #0000BB">pendingnum</span><span style="color: #007700">}&gt;<br />&nbsp;&nbsp;&nbsp;&lt;/</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;<br />&nbsp;&lt;/</span><span style="color: #0000BB">li</span><span style="color: #007700">&gt;<br />&nbsp;&lt;{/foreach}&gt;<br />&lt;/</span><span style="color: #0000BB">ul</span><span style="color: #007700">&gt;<br />&lt;{/foreach}&gt;</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br /><br /><strong>2)</strong> Modifica il file appena scaricato e che ora è in locale.<br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;{foreach&nbsp;</span><span style="color: #0000BB">item</span><span style="color: #007700">=</span><span style="color: #0000BB">module&nbsp;from</span><span style="color: #007700">=</span><span style="color: #0000BB">$block</span><span style="color: #007700">.</span><span style="color: #0000BB">modules</span><span style="color: #007700">}&gt;<br />&lt;</span><span style="color: #0000BB">b</span><span style="color: #007700">&gt;&lt;{</span><span style="color: #0000BB">$module</span><span style="color: #007700">.</span><span style="color: #0000BB">name</span><span style="color: #007700">}&gt;&lt;/</span><span style="color: #0000BB">b</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">ul</span><span style="color: #007700">&gt;<br />&nbsp;&lt;{foreach&nbsp;</span><span style="color: #0000BB">item</span><span style="color: #007700">=</span><span style="color: #0000BB">pending&nbsp;from</span><span style="color: #007700">=</span><span style="color: #0000BB">$module</span><span style="color: #007700">.</span><span style="color: #0000BB">pending</span><span style="color: #007700">}&gt;<br />&nbsp;&lt;</span><span style="color: #0000BB">li</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">a&nbsp;href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{$pending.adminlink}&gt;"</span><span style="color: #007700">&gt;&lt;{</span><span style="color: #0000BB">$pending</span><span style="color: #007700">.</span><span style="color: #0000BB">lang_linkname</span><span style="color: #007700">}&gt;&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;&nbsp;:<br />&nbsp;&nbsp;&nbsp;&lt;{if&nbsp;</span><span style="color: #0000BB">$pending</span><span style="color: #007700">.</span><span style="color: #0000BB">pendingnum</span><span style="color: #007700">}&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">font&nbsp;color</span><span style="color: #007700">=</span><span style="color: #0000BB">red</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">b</span><span style="color: #007700">&gt;&lt;{</span><span style="color: #0000BB">$pending</span><span style="color: #007700">.</span><span style="color: #0000BB">pendingnum</span><span style="color: #007700">}&gt;&lt;/</span><span style="color: #0000BB">b</span><span style="color: #007700">&gt;&lt;/</span><span style="color: #0000BB">font</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&lt;{else}&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;{</span><span style="color: #0000BB">$pending</span><span style="color: #007700">.</span><span style="color: #0000BB">pendingnum</span><span style="color: #007700">}&gt;<br />&nbsp;&nbsp;&nbsp;&lt;{/if}&gt;<br />&nbsp;&lt;/</span><span style="color: #0000BB">li</span><span style="color: #007700">&gt;<br />&nbsp;&lt;{/foreach}&gt;<br />&lt;/</span><span style="color: #0000BB">ul</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">hr&nbsp;</span><span style="color: #007700">/&gt;<br />&lt;{/foreach}&gt;</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br /><br /><strong>3)</strong> Se il tema è <strong>7dana-soft</strong>, tramite ftp, vai alla cartella /themes/dana-soft. Crea la cartella <strong>modules</strong>, e all'interno <strong>waiting</strong>, e ancora la cartella <strong>blocks</strong><br /><strong>4)</strong> Eseguiamo l'upload del file locale waiting_block_waiting.html nella cartella /themes/dana-soft/modules/waiting/blocks/ nel server.<br /><strong>5)</strong> Cancelliamo i file nella cartella /template_c (eccetto index.html) (o aggiorna la cache del modulo) per visualizzare i risultati...<br /><br />Immagine vecchia                                                                                        Imagine nuova<br /><== Blocco di defualt dei contenuti in attesa  -  Personalizzato ==><br /><br /><strong><a name="heading5" id="heading5"></a><h3>5) Override delle immagini</h3></strong><br />Infine, è possibile anche l'overriding di immagini. Ci sono 2 casi possibili:<br />- se il modulo usa l'overriding, puoi semplicemente copiare immagini nella stessa cartella del tema per overriding dei template del modulo,<br />- Modifichiamo un template in questo modo:<br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">img&nbsp;src</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{xoImgUrl&nbsp;modules/mymodule/images/image1.gif}&gt;"&nbsp;</span><span style="color: #0000BB">alt</span><span style="color: #007700">=</span><span style="color: #DD0000">""</span><span style="color: #007700">/&gt;</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br /><br /><strong>Esempio:</strong><br />Cambiare immagine dal modulo news (l'immagine print.gif) (template article.html dal modulo news)<br />Sostituiamo il codice seguente nel template article.html:<br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">img&nbsp;src</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{$xoops_url}&gt;/modules/news/images/print.gif"&nbsp;</span><span style="color: #0000BB">border</span><span style="color: #007700">=</span><span style="color: #DD0000">"0"&nbsp;</span><span style="color: #0000BB">alt</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{$lang_printerpage}&gt;"&nbsp;</span><span style="color: #007700">/&gt;</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br />con questo:<br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">img&nbsp;src</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{xoImgUrl&nbsp;modules/news/images/print.gif}&gt;"&nbsp;</span><span style="color: #0000BB">border</span><span style="color: #007700">=</span><span style="color: #DD0000">"0"&nbsp;</span><span style="color: #0000BB">alt</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{$lang_printerpage}&gt;"&nbsp;</span><span style="color: #007700">/&gt;</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br />Quando questa pagina sarà visualizzata, il template mostrerà l'immagine posizionata in /<cartella_tuotema>/modules/news/, e se l'immagine non esiste, sarà visualizzata l'immagine iniziale (/modules/news/images).<br /><br /><strong><a name="heading6" id="heading6"></a><h3>6) Note e altri override</h3> </strong><br /><strong>Nota 1:</strong><br />In entrambi gli esempi, abbiamo semplicemente modificato i template dei blocchi, per i template delle pagine, fai l'upload dei tuoi file in:<br />/<cartella_tuotema>/modules/miomodulo e non in /<cartella_tuotema>/modules/miomodulo/blocks.<br /><br /><strong>Nota 2:</strong><br />Dai un'occhiata a questo tema, [url:<a href="http://www.7dana.com/download/pafiledb.php?action=file&id=21" title="http://www.7dana.com/download/pafiledb.php?action=file&id=21" target="_blank">http://www.7dana.com/download/pafiledb.php?action=file&id=21</a>]7dana-clean[/url].<br />In questo tema troverai:<br />- La nuova posizione dei blocchi (blocchi basso centrale, blocchi basso sinistra, blocchi basso destra)<br />- 7 template per l'overriding<br /><br /><strong>Nota 3:</strong><br />Copia index.html (dalla cartella templtate_c o in ogni altra cartella del core contenente index.html) nella nuova cartella del modulo nel tuo tema.<br /><br /><strong>Override del CSS</strong><br />Per i CSS, l'overriding è utilizzato alla stessa maniera, ma il comando è differente:<br /><{$xoTheme->addStylesheet('modules/news/style.css')}><br /><br /><strong>javascript overriding</strong><br />Presto maggiori informazioni.<br /><br />---------------<br /><br />Articolo originale: <a href="http://www.xoops.org/modules/news/article.php?storyid=3367" title="http://www.xoops.org/modules/news/article.php?storyid=3367" target="_blank">http://www.xoops.org/modules/news/article.php?storyid=3367</a><br />Traduzione a cura di flymirko<br />]]></description>
            <author>ianez</author>
            <pubDate>Tue, 22 Jan 2008 11:05:26 +0200</pubDate>
        </item>
    </channel>
</rss>
