Jump to content

Hide the left column in all brands page


_Veronika_

Recommended Posts

Hello everybody

Im struggling with the configuration in the web, I want to show in brand page the left column but I want to hide it when all brands is showing. These pages seem to be connected because when I turn off the left column in theme setting disapears in both pages. Is there a way to hide in all brands page but show it in the manufacturer page???

Im using prestashop 8.1 and classic theme by default. Hope someone can help me, thanks

Link to comment
Share on other sites

On 4/23/2024 at 7:24 PM, _Veronika_ said:

Hello everybody

Im struggling with the configuration in the web, I want to show in brand page the left column but I want to hide it when all brands is showing. These pages seem to be connected because when I turn off the left column in theme setting disapears in both pages. Is there a way to hide in all brands page but show it in the manufacturer page???

Im using prestashop 8.1 and classic theme by default. Hope someone can help me, thanks

Hi,

In this directory, themes/classic/templates look for the code that usually enclosed within {block name="left_column"} and {/block} tags. Surround the code for the left column with a conditional statement that checks if the current page is a brand page or a manufacturer page.

Sample code  :

{if $page.page_name == 'manufacturer' || $page.page_name == 'brand'}
    {block name="left_column"}
        // left column content here
    {/block}
{/if}

Clear the cache after making the changes and test if it works.

I hope this would help.

Thanks!

Edited by AddWeb Solution (see edit history)
Link to comment
Share on other sites

Le 23/04/2024 à 5:30 PM, _Veronika_ a dit :

@Prestashop Addict thanks. Could you tell me which file I have to modify? 

 

Here is a solution based on classic theme. In template layout-both-columns.tpl line 65

          <div class="row">
            {block name="left_column"}
              <div id="left-column" class="col-xs-12 col-md-4 col-lg-3">
                {if $page.page_name == 'product'}
                  {hook h='displayLeftColumnProduct' product=$product category=$category}
                {else}
                  {hook h="displayLeftColumn"}
                {/if}
              </div>
            {/block}

add

          <div class="row">
            {block name="left_column"}
{if $page.page_name != 'manufacturer' || isset($smarty.get.id_manufacturer)}
              <div id="left-column" class="col-xs-12 col-md-4 col-lg-3">
                {if $page.page_name == 'product'}
                  {hook h='displayLeftColumnProduct' product=$product category=$category}
                {else}
                  {hook h="displayLeftColumn"}
                {/if}
              </div>
{/if}
            {/block}

 

Edited by Prestashop Addict (see edit history)
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...