18/05/2012, 19:55:24
Voilà le code complet avec affichage ou non de la navigation et des blocs suivant leur remplissage :
Code :
<body>
{capture name=bloc1}{content block="bloc1" label="bloc1"}{/capture}
{capture name=bloc2}{content block="bloc2" label="bloc2"}{/capture}
{capture name=bloc3}{content block="bloc3" label="bloc3"}{/capture}
{capture name=bloc4}{content block="bloc4" label="bloc4"}{/capture}
{capture name=bloc5}{content block="bloc5" label="bloc5"}{/capture}
<div id="header">
<div id="menu">
<ul>
<li><a href="#top">Accueil</a></li>
<li><a href="#img1">Image 1</a></li>
{if $smarty.capture.bloc1 ne ""}
<li><a href="#img2">Image 2</a></li>
{/if}
{if $smarty.capture.bloc2 ne ""}
<li><a href="#img3">Image 3</a></li>
{/if}
{if $smarty.capture.bloc3 ne ""}
<li><a href="#img4">Image 4</a></li>
{/if}
{if $smarty.capture.bloc4 ne ""}
<li><a href="#img5">Image 5</a></li>
{/if}
{if $smarty.capture.bloc5 ne ""}
<li><a href="#img6">Image 6</a></li>
{/if}
</ul>
</div><!-- #menu -->
</div><!-- #header -->
<div id="container">
<div id="top"></div>
<div id="img1"></div>
<div class="image-ombre">{content}</div>
{if $smarty.capture.bloc1 ne ""}
<div id="img2"></div>
<div class="image-ombre">{$smarty.capture.bloc1}</div>
{/if}
{if $smarty.capture.bloc2 ne ""}
<div id="img3"></div>
<div class="image-ombre">{$smarty.capture.bloc2}</div>
{/if}
{if $smarty.capture.bloc3 ne ""}
<div id="img4"></div>
<div class="image-ombre">{$smarty.capture.bloc3}</div>
{/if}
{if $smarty.capture.bloc4 ne ""}
<div id="img5"></div>
<div class="image-ombre">{$smarty.capture.bloc4}</div>
{/if}
{if $smarty.capture.bloc5 ne ""}
<div id="img6"></div>
<div class="image-ombre">{$smarty.capture.bloc5}</div>
{/if}
<div id="espace-bas"></div>
</div><!-- #container -->
</body>