Jump to content

Relative or absolute links in blocktopmenu (non hardcoded) ?


PBo34
 Share

Recommended Posts

Hi,

 

I'm stuck on a problem since this morning, which seems very basic, yet I can't find the solution.

Google webmaster tools give me errors about some links which I have created in blocktopmenu to insert sales and best-sellers.

 

For instance, the page "prices drop" has its rewritten URL declared in SEO&URLS as "prices-drop".

In the blocktopmenu configuration, I have created a link that I put in the menu with the relative URL "prices-drop".

Now when you are navigating in a category, the URL is not found since "prices_drop" is put under the category URL.

 

I would like to give an absolute URL to specify that this is under the root of the site, of course without hardcoding the the domain. Is there a simple solution to this? What am I doing wrong?

 

When I try something like "{$link->getPageLink('prices-drop')}"; the expression is not interpreted and simply added to the local URL.

 

Thank you in advance.

 

 

 

 

Share this post


Link to post
Share on other sites

For example on my testsite :

 

If I'm on the home page, I click (in French) Promotions , the requested URL is http://192.168.1.12/prestashop/fr/promotions, it's OK.

If I navigate into a category then into a product.

The URL is http://192.168.1.12/prestashop/fr/batteries-li-ion/27-batterie-berner-36v-li-ion-13-ah.html

In this page in click Promotions, the resulting URL is

http://192.168.1.12/prestashop/fr/batteries-li-ion/promotions resulting in a 404.

Share this post


Link to post
Share on other sites

Since google gave me a warning for many 404 errors, I had to change those links for absolute links with domain hardcoded.

This is definitely a bad fix that will endlessly give me trouble everytime I download the prod on the test site or vice-versa.

I hope it's just a temporary bad fix and a good solution will be found soon, as this seems a trivial question.

The links for sales or best-sellers in the footer don't have this problem.

Edited by PBo34 (see edit history)

Share this post


Link to post
Share on other sites

So should I understand that it has not been programmed properly from the start, to use the domain declared in SEO&URLs?

 

Is there a way to declare the link in blocktopmenu using the variable: eg. {$link->getPageLink('prices-drop')} ?

It would be a easy solution? Why is it not interpreted? I don't have the knowledge of how the software layers interact to understand why it is not interpreted?

Share this post


Link to post
Share on other sites

  • 1 month later...

If anybody has the same problem...  I just stumbled upon this idea today, tried it, and it does what it should do:

/meilleures-ventes

/best-sales

etc.

As I thought from the start, this is trivial.

Share this post


Link to post
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More