Jump to content

How to remove Title Heading section if CMS page (not category or product page)


8ternity

Recommended Posts

Hi,

In Prestashop 1.7.5.X i want to remove the title name for CMS PAGE (Conception > Pages).

I've located the file into Template/page.tpl we can see:

 

<section id="main">
    {block name='page_header_container'}
      {block name='page_title' hide}
        <h1 class="page-heading">{$smarty.block.child}</h1>
      {/block}
    {/block}


I want to add a {if} rule which says

- If page-content is cms page "not show this section/or bypass to add the <h1>...</h1>" otherwise show the <h1> class.

I have no such experience in developping. 

Anyone experienced with that?

Any help is appreciated.

Thanks.

8ternity | Montreal | Canada

Link to comment
Share on other sites

Not working.

The full path is "/html/body/main/section/div/div/div/div/div/section/h1" 

Their is not #cms section in the HTML itself. It's why i think a {if} rules. But i don't know well in php or smarty programmation. I have knowledge on HTML and CSS only. 

 

2020-01-27_10h21_01.png

 

If i use #main, all titles will not be shown (product pages, etc.)

 

Edited by 8ternity (see edit history)
Link to comment
Share on other sites

Sorry, Please try the below code.

#cms .page-heading {

display: none;

}

We can see that you header title class is page-heading instead of page-header. #cms i.e. ID of of element is added on the body. Its has been added purposely so that heading will be hidden only from the CMS page. otherwise heading will be removed from the the pages as well.
https://nimb.ws/Os2n4U

Edited by Knowband Plugins
Spell mistake (see edit history)
Link to comment
Share on other sites

  • 1 year later...
On 1/24/2020 at 5:23 PM, 8ternity said:

Hi,

In Prestashop 1.7.5.X i want to remove the title name for CMS PAGE (Conception > Pages).

I've located the file into Template/page.tpl we can see:

 

<section id="main">
    {block name='page_header_container'}
      {block name='page_title' hide}
        <h1 class="page-heading">{$smarty.block.child}</h1>
      {/block}
    {/block}


I want to add a {if} rule which says

- If page-content is cms page "not show this section/or bypass to add the <h1>...</h1>" otherwise show the <h1> class.

I have no such experience in developping. 

Anyone experienced with that?

Any help is appreciated.

Thanks.

8ternity | Montreal | Canada

try with: 

{if $page.page_name != 'cms'}
	<h1 class="page-heading">{$smarty.block.child}</h1>
{/if}

In this way, it load the <h1> tag except for cms pages (all)

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