Jump to content

PS 1.7.8 How to remove header and footer from authentification page


alphaci

Recommended Posts

Hello,

As said in the title, I'd like to remove the header and footer from authentication page. I looked at the authentication.tpl file but there is no block for the header or the footer. I don't want to add a display none because I don't want people to be able to see the header and footer if they inspect the page. In another topic someone said to do this to "call an empty footer/header" :

{if $category_id != $xx}

... CONTENT ... 

{/if} 

but I don't know in what file nor what I am supposed to write instead of content or $xx.

Can someone help me ?

Edited by alphaci
forgot some informations (see edit history)
Link to comment
Share on other sites

To remove the header and footer from the authentication page (login and registration pages) in PrestaShop 1.7.8, you can edit the authentication.tpl file, which is located in the /themes/your_theme/templates/customer/ directory.

Open the authentication.tpl file in a text editor.

Locate the following code block, which displays the header:

{block name='header'}
  {include file='customer/_partials/header.tpl'}
{/block}

Remove or comment out this code block by placing {/* and */} around it, so that it looks like this:

{/*
{block name='header'}
  {include file='customer/_partials/header.tpl'}
{/block}
*/}

Locate the following code block, which displays the footer:

{block name='footer'}
  {include file='customer/_partials/footer.tpl'}
{/block}

Remove or comment out this code block by placing {/* and */} around it, so that it looks like this:

{/*
{block name='footer'}
  {include file='customer/_partials/footer.tpl'}
{/block}
*/}

Save the changes to the authentication.tpl file and refresh the authentication page in your browser to see the changes.

Note that this will remove the header and footer from the authentication page only. The header and footer will still be displayed on other pages of your PrestaShop store

Link to comment
Share on other sites

thanks for your response. The problem is that I don't have these code blocks in the authentication.tpl file. This is all there is :

{extends file='page.tpl'}

{block name='page_title'}
  {l s='Log in to your account' d='Shop.Theme.Customeraccount'}
{/block}

{block name='page_content'}
    {block name='login_form_container'}
      <section class="login-form">
        {render file='customer/_partials/login-form.tpl' ui=$login_form}
      </section>
      <hr/>
      {block name='display_after_login_form'}
        {hook h='displayCustomerLoginFormAfter'}
      {/block}
      <div class="no-account">
        <a href="{$urls.pages.register}" data-link-action="display-register-form">
          {l s='No account? Create one here' d='Shop.Theme.Customeraccount'}
        </a>
      </div>
    {/block}
{/block}

 

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

If the auth.tpl file does not contain the code blocks that I mentioned, it is likely that your theme is using a different method to display the header and footer on the authentication page. In this case, you will need to edit the appropriate file in your theme to remove the header and footer.

To determine which file you need to edit, you can try looking for the code that displays the header and footer on other pages of your website. For example, the code for the header and footer is typically included in the header.tpl and footer.tpl files, which are located in the themes/your_theme/templates directory.

Once you have found the code that displays the header and footer, you can try looking for a reference to the auth.tpl file in that code. This will tell you which file you need to edit to remove the header and footer from the authentication page.

For example, if the code that displays the header and footer on other pages of your website looks like this:
 

{include file='_partials/header.tpl'}

{include file='customer/authentication.tpl'}

{include file='_partials/footer.tpl'}

Then you would need to edit the file that contains this code (it could be the header.tpl file or another file) in order to remove the header and footer from the authentication page.

Once you have found the correct file, you can remove the code that includes the header.tpl and footer.tpl files by deleting it or commenting it out as I mentioned in my previous response.

Keep in mind that the exact method for removing the header and footer from the authentication page will vary depending on your theme and how it is structured, so you may need to experiment or consult a developer for help.

Link to comment
Share on other sites

So I've looked in the files and the code to display files does look like this :

{include file='customer/authentication.tpl'}

However, I didn't manage to find the files that include the footer and header. I use the classic theme, would you happen to know what those files are ?

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