Jump to content

Define specific URL with if conditions


tareqhassan

Recommended Posts

Hello experts,

 

I'm a small developer with very few knowledge in prestashop CMS. I tried to put if conditions in the header.tpl section with specific ulrs but can't work it out. 

{if $page_name=='index'}
<link rel="canonical" href="{$base_dir}" />

{elseif 'base_url' =>'http://example.com/product.html'}
<link rel="canonical" href="http://example.com/product.html"/>

{else}
<link rel="canonical" href="http://{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}" />
 {/if}

1st and last part of this code is working but middle one is not working. How can i define a specific condition for specific url with if condition? 

 

Please note that, i don't need solutions of canonical tags, just need to know how to declare the url with if conditions in prestashop?

 

Thanks in advance

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

  • 1 month later...

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