Jump to content

Use of {$page_name} in blocktopmenu.tpl


anmihe

Recommended Posts

Hi guys,

 

Trying to ad a login and registrer form in a drop down inside the blocktopmenu.tpl. Everything works fine unless it's an invalid input, then the user get sent to the login page showing the error messages. This would be ok but now I got two login/reg forms on that page.

 

So I want it not to show if the user is on the login page so was gonna use {if $page_name == 'authentication'} to not print the forms as a menu item if on the login page then the login/reg form if the user is anywere else and not logged in.

 

But $page_name returns "authentication" when beeing on the home page when put in the blocktopmenu.tpl ...but return right if on a product or category page ...and returns index when actually on the authentication....and sometimes right depending on from what page I came from.

 

So assuming this is a caching issue? Or?

 

Is there another statement or methtod to use to achive this?

Is there a simple way to fix the caching issue?

 

Thanks in advance!

 

/A

Link to comment
Share on other sites

Posted a bit to fast... :)

 

If I disable the smarty cache this works just fine, but when turned back on it reutns inxed for the login page and authentication for index.

 

So caching issue for sure.

 

How would I solved this without disabeling the cache?

 

Thanks

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

I have the same problem. I would like to display class only if page == index in blocksearch_top.tpl

<div id="search_block_top" class="col-sm-4 clearfix {if $page_name =='index'}search-index{/if}">

How can I resolve this ?

 

You may can try with this :

<div id="search_block_top" class="col-sm-4 clearfix {if $page_name eq 'index'}search-index{/if}">

I have replaced the == with a eq for me works great

 

Regards

Link to comment
Share on other sites

You may can try with this :

<div id="search_block_top" class="col-sm-4 clearfix {if $page_name eq 'index'}search-index{/if}">

I have replaced the == with a eq for me works great

 

Regards

 

Thank you! Now, after 18 months of waiting, because of you I was able to solve this problem!  :ph34r:  :ph34r:  :ph34r:

Link to comment
Share on other sites

Thank you! Now, after 18 months of waiting, because of you I was able to solve this problem!  :ph34r:  :ph34r:  :ph34r:

 

Have a lot of topics, and respond all it's a little difficult, I'd want propose to Prestashop to integrate the forum on Stack Exchange, it's more quickly and have more active users

 

Let us know if the solution work for you too

 

Regards,

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