Jump to content

[SOLVED] module exception for some cms pages


Recommended Posts

it's not possible to define exception for "certain" cms pages only (with default features in BO)

in this case, it's necessary to modify module template file.

{assign var='hidemodule' value='0'}
{if isset($smarty.get.controller)}
    {if $smarty.get.id_cms==3}
       {assign var='hidemodule' value='1'}
    {else}
       {assign var='hidemodule' value='0'}
    {/if}
{if} 

where id_cms is an id of page, where you want to hide module

then you can use there code:

{if $hidemodule!=1}
CONTENTS OF TPL HERE
{/if}
Link to comment
Share on other sites

 

it's not possible to define exception for "certain" cms pages only (with default features in BO)

in this case, it's necessary to modify module template file.

{assign var='hidemodule' value='0'}
{if isset($smarty.get.controller)}
    {if $smarty.get.id_cms==3}
       {assign var='hidemodule' value='1'}
    {else}
       {assign var='hidemodule' value='0'}
    {/if}
{if} 

where id_cms is an id of page, where you want to hide module

then you can use there code:

{if $hidemodule!=1}
CONTENTS OF TPL HERE
{/if}

Hi

 

Thank you for such fast answer but i didnt get any result

Maybe you could show me how should it look in code

 

This is my module code:

<!-- Block categories module -->

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

    <p class="title_block">{l s='Categories' mod='blockcategories'}</p>

    <div class="block_content">

        <ul class="tree {if $isDhtml}dhtml{/if}">

        {foreach from=$blockCategTree.children item=child name=blockCategTree}

            {if $smarty.foreach.blockCategTree.last}

                {include file="$branche_tpl_path" node=$child last='true'}

            {else}

                {include file="$branche_tpl_path" node=$child}

            {/if}

        {/foreach}

        </ul>

        {* Javascript moved here to fix bug #PSCFI-151 *}

        <script type="text/javascript">

        // <![CDATA[

            // we hide the tree only if JavaScript is activated

            $('div#categories_block_left ul.dhtml').hide();

        // ]]>

        </script>

    </div>

</div>

<!-- /Block categories module -->

 

Link to comment
Share on other sites

{assign var='hidemodule' value='0'}
{if isset($smarty.get.controller)}
    {if $smarty.get.id_cms==3}
       {assign var='hidemodule' value='1'}
    {else}
       {assign var='hidemodule' value='0'}
    {/if}
{if} 

{if $hidemodule!=1}
<!-- Block categories module -->
<div id="categories_block_left" class="block">
    <p class="title_block">{l s='Categories' mod='blockcategories'}</p>
    <div class="block_content">
        <ul class="tree {if $isDhtml}dhtml{/if}">
        {foreach from=$blockCategTree.children item=child name=blockCategTree}
            {if $smarty.foreach.blockCategTree.last}
                {include file="$branche_tpl_path" node=$child last='true'}
            {else}
                {include file="$branche_tpl_path" node=$child}
            {/if}
        {/foreach}
        </ul>
        {* Javascript moved here to fix bug #PSCFI-151 *}
        <script type="text/javascript">
        // <![CDATA[
            // we hide the tree only if JavaScript is activated
            $('div#categories_block_left ul.dhtml').hide();
        // ]]>
        </script>
    </div>
</div>
<!-- /Block categories module -->
{/if}

try with this - remember about changing ID of cms page

Link to comment
Share on other sites

{assign var='hidemodule' value='0'}
{if isset($smarty.get.controller)}
    {if $smarty.get.id_cms==3}
       {assign var='hidemodule' value='1'}
    {else}
       {assign var='hidemodule' value='0'}
    {/if}
{if} 

{if $hidemodule!=1}
<!-- Block categories module -->
<div id="categories_block_left" class="block">
    <p class="title_block">{l s='Categories' mod='blockcategories'}</p>
    <div class="block_content">
        <ul class="tree {if $isDhtml}dhtml{/if}">
        {foreach from=$blockCategTree.children item=child name=blockCategTree}
            {if $smarty.foreach.blockCategTree.last}
                {include file="$branche_tpl_path" node=$child last='true'}
            {else}
                {include file="$branche_tpl_path" node=$child}
            {/if}
        {/foreach}
        </ul>
        {* Javascript moved here to fix bug #PSCFI-151 *}
        <script type="text/javascript">
        // <![CDATA[
            // we hide the tree only if JavaScript is activated
            $('div#categories_block_left ul.dhtml').hide();
        // ]]>
        </script>
    </div>
</div>
<!-- /Block categories module -->
{/if}

try with this - remember about changing ID of cms page

 

Thank you

Before I tried the same but still have blank screen after using this code

Link to comment
Share on other sites

i checked code once again, 

try with this:
 

{assign var='hidemodule' value='0'}
    {if $smarty.get.id_cms==3}
       {assign var=hidemodule value='1'}
    {else}
       {assign var=hidemodule value='0'}
    {/if}
{if $hidemodule!=1}
<!-- Block categories module -->
<div id="categories_block_left" class="block">
    <p class="title_block">{l s='Categories' mod='blockcategories'}</p>
    <div class="block_content">
        <ul class="tree {if $isDhtml}dhtml{/if}">
        {foreach from=$blockCategTree.children item=child name=blockCategTree}
            {if $smarty.foreach.blockCategTree.last}
                {include file="$branche_tpl_path" node=$child last='true'}
            {else}
                {include file="$branche_tpl_path" node=$child}
            {/if}
        {/foreach}
        </ul>
        {* Javascript moved here to fix bug #PSCFI-151 *}
        <script type="text/javascript">
        // <![CDATA[
            // we hide the tree only if JavaScript is activated
            $('div#categories_block_left ul.dhtml').hide();
        // ]]>
        </script>
    </div>
</div>
<!-- /Block categories module -->
{/if}
Link to comment
Share on other sites

 

i checked code once again, 

try with this:

 

{assign var='hidemodule' value='0'}
    {if $smarty.get.id_cms==3}
       {assign var=hidemodule value='1'}
    {else}
       {assign var=hidemodule value='0'}
    {/if}
{if $hidemodule!=1}
<!-- Block categories module -->
<div id="categories_block_left" class="block">
    <p class="title_block">{l s='Categories' mod='blockcategories'}</p>
    <div class="block_content">
        <ul class="tree {if $isDhtml}dhtml{/if}">
        {foreach from=$blockCategTree.children item=child name=blockCategTree}
            {if $smarty.foreach.blockCategTree.last}
                {include file="$branche_tpl_path" node=$child last='true'}
            {else}
                {include file="$branche_tpl_path" node=$child}
            {/if}
        {/foreach}
        </ul>
        {* Javascript moved here to fix bug #PSCFI-151 *}
        <script type="text/javascript">
        // <![CDATA[
            // we hide the tree only if JavaScript is activated
            $('div#categories_block_left ul.dhtml').hide();
        // ]]>
        </script>
    </div>
</div>
<!-- /Block categories module -->
{/if}

Thank you very much again! 

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...