- Posts: 47
- Thank you received: 3
breadcrumbs and module position
2 years 2 months ago #362289
by diacotm
breadcrumbs and module position was created by diacotm
-- HikaShop version -- : 5.0.2
-- Joomla version -- : 5.1.2
-- PHP version -- : 8.1.13
-- Browser(s) name and version -- : firefox
Hi,
when opening a product through the category listing, everything seems ok, I mean the breadcrumbs display a complete path to the top category and on the product's page there is no module with a module position in the product's top area but when I use the HikaShop Content Module and open a product though the module, breadcrumbs just display "Home/'Product name'" and in the top area of product page I have unwanted module with module position,
what should I do to make a product have the same breadcrumbs as when opened through the category listing?
Thanks in advance
-- Joomla version -- : 5.1.2
-- PHP version -- : 8.1.13
-- Browser(s) name and version -- : firefox
Hi,
when opening a product through the category listing, everything seems ok, I mean the breadcrumbs display a complete path to the top category and on the product's page there is no module with a module position in the product's top area but when I use the HikaShop Content Module and open a product though the module, breadcrumbs just display "Home/'Product name'" and in the top area of product page I have unwanted module with module position,
what should I do to make a product have the same breadcrumbs as when opened through the category listing?
Thanks in advance
Please Log in or Create an account to join the conversation.
2 years 2 months ago #362290
by nicolas
Replied by nicolas on topic breadcrumbs and module position
Hi,
The goal of the breadcrumbs is to allow the user to know where he comes from. So it's normal that by default, if he comes from a module, the breadcrumbs doesn't display the path through a category, since he actually didn't go through a category to reach the page.
Note that this means that if you have several ways to access a product page, you'll have different URLs to reach it. This will cause "duplicate content" issues with SEO.
To avoid this problem, you want to enter the main URL of each product in the "canonical URL" field of each product.
This way, it will tell search engines that regardless the URL they use to reach the product page, this is the main URL you want to be indexed for this page.
Following this, if you want your users to also always use that same URL to access the product page (so you can for example make sure that the breadcrumbs is consistent, regardless from where you access the product page), you can turn on the "force canonical URLs on listings" setting of the HikaShop configuration page so that it uses the canonical URL.
The goal of the breadcrumbs is to allow the user to know where he comes from. So it's normal that by default, if he comes from a module, the breadcrumbs doesn't display the path through a category, since he actually didn't go through a category to reach the page.
Note that this means that if you have several ways to access a product page, you'll have different URLs to reach it. This will cause "duplicate content" issues with SEO.
To avoid this problem, you want to enter the main URL of each product in the "canonical URL" field of each product.
This way, it will tell search engines that regardless the URL they use to reach the product page, this is the main URL you want to be indexed for this page.
Following this, if you want your users to also always use that same URL to access the product page (so you can for example make sure that the breadcrumbs is consistent, regardless from where you access the product page), you can turn on the "force canonical URLs on listings" setting of the HikaShop configuration page so that it uses the canonical URL.
Please Log in or Create an account to join the conversation.
2 years 1 month ago #362328
by diacotm
Replied by diacotm on topic breadcrumbs and module position
Hi,
Thanks for your clear response,
when I link the module to a menu option, the link and breadcrumbs will be OK,
I designed two modules for Hikashop with a custom layout, but I can't add a menu option to them to fix the breadcrumbs issue, is it possible to send them and help me with them?
Thanks in advance
Thanks for your clear response,
when I link the module to a menu option, the link and breadcrumbs will be OK,
I designed two modules for Hikashop with a custom layout, but I can't add a menu option to them to fix the breadcrumbs issue, is it possible to send them and help me with them?
Thanks in advance
Please Log in or Create an account to join the conversation.
2 years 1 month ago #362335
by nicolas
Replied by nicolas on topic breadcrumbs and module position
Hi,
Sure. You can attach them here. If you want to send them privately, you can go through our contact form:
www.hikashop.com/support/contact-us.html
But normally, it's quite easy.
Where you generate the URL of the products in your module's code, you can just add the parameter &Itemid=xxx in the URL, where xxx is the id of the menu item you want to use.
That's basically what HikaShop does when you provide a menu item in the menu setting of the HikaShop content module.
Sure. You can attach them here. If you want to send them privately, you can go through our contact form:
www.hikashop.com/support/contact-us.html
But normally, it's quite easy.
Where you generate the URL of the products in your module's code, you can just add the parameter &Itemid=xxx in the URL, where xxx is the id of the menu item you want to use.
That's basically what HikaShop does when you provide a menu item in the menu setting of the HikaShop content module.
Please Log in or Create an account to join the conversation.
2 years 1 month ago #362346
by diacotm
Replied by diacotm on topic breadcrumbs and module position
Please Log in or Create an account to join the conversation.
2 years 1 month ago #362348
by nicolas
Replied by nicolas on topic breadcrumbs and module position
Hi,
Well, that's exactly what I was saying in my previous message.
For example, in the file tmpl/default.php of the first module mod_hikashop_2x2productdisplayRev02-Nobreadcrumbs.zip you have the line:
You want to change it to:
where xx is the id of the menu item you want to be used by the module.
Well, that's exactly what I was saying in my previous message.
For example, in the file tmpl/default.php of the first module mod_hikashop_2x2productdisplayRev02-Nobreadcrumbs.zip you have the line:
Code:
<a class="hphimod4pconrca" href="<?php echo JRoute::_('index.php?option=com_hikashop&ctrl=product&task=show&cid=' . $item->product_id); ?>">
Code:
<a class="hphimod4pconrca" href="<?php echo JRoute::_('index.php?option=com_hikashop&ctrl=product&task=show&cid=' . $item->product_id.'&Itemid=xx'); ?>">
Please Log in or Create an account to join the conversation.
2 years 1 month ago #362392
by diacotm
Replied by diacotm on topic breadcrumbs and module position
Perfect!
I added a filed to the admin area to let user enter the menu id and add to the link that you mentioned and now breadcrumbs work perfectly!
I use the product id to let the module access the product, what is the default address for the hikashop link when opening the product?
Thank you so much
I added a filed to the admin area to let user enter the menu id and add to the link that you mentioned and now breadcrumbs work perfectly!
I use the product id to let the module access the product, what is the default address for the hikashop link when opening the product?
Thank you so much
Please Log in or Create an account to join the conversation.
2 years 1 month ago #362394
by nicolas
Replied by nicolas on topic breadcrumbs and module position
Hi,
It's almost this URL. We also add a parameter "name" to the URL with the alias of the product.
It's almost this URL. We also add a parameter "name" to the URL with the alias of the product.
Please Log in or Create an account to join the conversation.
Time to create page: 0.349 seconds