Jump to content

[Résolu] exceptions des modules


Recommended Posts

On peut mettre une condition dans le tpl avec le nom de la page où tu veux afficher le module.

exemple :

{if $page_name==category}{/if}

Merci bien de ta réponse :D , je vais essayer au pif parce que je sais pas où je dois marquer la condition.

Link to comment
Share on other sites

Bonjour, Grafics,

 

Il s'agit d'afficher un bloc sur une page CMS, voilà ce que j'ai fait et le site ne s'affiche toujours plus en local:

 

 

<!-- Block Newsletter module-->

{if $page_name==cms.php?id_cms=6}

<div id="newsletter_block_left" class="block">

<h4>{l s='Newsletter' mod='blocknewsletter'}</h4>

<div class="block_content">

{if isset($msg) && $msg}

<p class="{if $nw_error}warning_inline{else}success_inline{/if}">{$msg}</p>

{/if}

<form action="{$link->getPageLink('index.php')}" method="post">

<p><input type="text" name="email" size="18" value="{if isset($value) && $value}{$value}{else}{l s='your e-mail' mod='blocknewsletter'}{/if}" onfocus="javascript:if(this.value=='{l s='your e-mail' mod='blocknewsletter'}')this.value='';" onblur="javascript:if(this.value=='')this.value='{l s='your e-mail' mod='blocknewsletter'}';" /></p>

<p>

<select name="action">

<option value="0"{if isset($action) && $action == 0} selected="selected"{/if}>{l s='Subscribe' mod='blocknewsletter'}</option>

<option value="1"{if isset($action) && $action == 1} selected="selected"{/if}>{l s='Unsubscribe' mod='blocknewsletter'}</option>

</select>

<input type="submit" value="ok" class="button_mini" name="submitNewsletter" />

</p>

</form>

</div>

</div>

{/if}

<!-- /Block Newsletter module-->

Link to comment
Share on other sites

C'est normal que cela ne marche pas, le nom de la page est soit category, product, cms... pas de numéro ou autre.

Essaye :

{if $page_name==cms}{if $smarty.get.id_cms==6}
<div id="newsletter_block_left" class="block">
<h4>{l s='Newsletter' mod='blocknewsletter'}</h4>
<div class="block_content">
{if isset($msg) && $msg}
<p class="{if $nw_error}warning_inline{else}success_inline{/if}">{$msg}</p>
{/if}
<form action="{$link->getPageLink('index.php')}" method="post">
<p><input type="text" name="email" size="18" value="{if isset($value) && $value}{$value}{else}{l s='your e-mail' mod='blocknewsletter'}{/if}" onfocus="javascript:if(this.value=='{l s='your e-mail' mod='blocknewsletter'}')this.value='';" onblur="javascript:if(this.value=='')this.value='{l s='your e-mail' mod='blocknewsletter'}';" /></p>
<p>
<select name="action">
<option value="0"{if isset($action) && $action == 0} selected="selected"{/if}>{l s='Subscribe' mod='blocknewsletter'}</option>
<option value="1"{if isset($action) && $action == 1} selected="selected"{/if}>{l s='Unsubscribe' mod='blocknewsletter'}</option>
</select>
<input type="submit" value="ok" class="button_mini" name="submitNewsletter" />
</p>
</form>
</div>
</div>
{/if}{/if}
<!-- /Block Newsletter module-->

Link to comment
Share on other sites

Un grand merci à toi, Graphics, çà marche!

 

 

C'est normal que cela ne marche pas, le nom de la page est soit category, product, cms... pas de numéro ou autre.

Essaye :

{if $page_name==cms}{if $smarty.get.id_cms==6}
<div id="newsletter_block_left" class="block">
<h4>{l s='Newsletter' mod='blocknewsletter'}</h4>
<div class="block_content">
{if isset($msg) && $msg}
<p class="{if $nw_error}warning_inline{else}success_inline{/if}">{$msg}</p>
{/if}
<form action="{$link->getPageLink('index.php')}" method="post">
<p><input type="text" name="email" size="18" value="{if isset($value) && $value}{$value}{else}{l s='your e-mail' mod='blocknewsletter'}{/if}" onfocus="javascript:if(this.value=='{l s='your e-mail' mod='blocknewsletter'}')this.value='';" onblur="javascript:if(this.value=='')this.value='{l s='your e-mail' mod='blocknewsletter'}';" /></p>
<p>
<select name="action">
<option value="0"{if isset($action) && $action == 0} selected="selected"{/if}>{l s='Subscribe' mod='blocknewsletter'}</option>
<option value="1"{if isset($action) && $action == 1} selected="selected"{/if}>{l s='Unsubscribe' mod='blocknewsletter'}</option>
</select>
<input type="submit" value="ok" class="button_mini" name="submitNewsletter" />
</p>
</form>
</div>
</div>
{/if}{/if}
<!-- /Block Newsletter module-->

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...