Problems with SEF URL's

  • Posts: 250
  • Thank you received: 7
10 years 1 month ago #206619

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.1

Hi,

Hopefully my last problem with this current project.

I have implemented access to my shop in two ways, one via a manually constructed Joomla menu linking to shop categories, the other by a Hikashop content module in a sidebar as per the screenshot




I want the URL's to products in my shop to exactly reflect the hierarchy of the store as recommended by Google for SEO. I can achieve this exactly for the Joomla menu items, so a product called "Windpower Sketch Paper" in the "Sketch Paper" subcategory of the "Drawing and Illustration" category has the URL (via manually constructed menu) ...

/shop/drawing-and-illustration-paper/sketch-paper/windpower-sketch-paper
Perfect, the url has been constructed using aliases which is what I want!

My problem is with the Content Module, when I turn sef on the link to the same product is ...

shop/windpower-sketch-paper/category_pathway-143
which is completely useless, where has "category_pathway-143" come from?
why can't I see the category heirachy?

Also the link to the Sketch paper category when using the menu is...
shop/drawing-and-illustration-paper/sketch-paper
again, perfect

But from the content module ...
/Shop/category/sketch-paper
not so good.

How can I get rid of the word category in the path from the content module ? It seems I have to have either a category or product reference in the URL, I can get rid of one but not both, why is that?

Finally, I have the menu option of the content module set to "Shop" but that setting doesn't seem to make any difference.

I Have SH404SEF installed but turned off, I am just using Joomla SEF at this stage

How do I resolve this one please?

Thanks,

Ian

Attachments:
Last edit: 10 years 1 month ago by iedwards.

Please Log in or Create an account to join the conversation.

  • Posts: 84233
  • Thank you received: 13673
  • MODERATOR
10 years 1 month ago #206630

Hi,

You want to make sure that the "Force canonical URLs on listings" setting of the HikaShop configuration is turned on.
Then, in each category, you can fill in the "canonical URL" field the URL that you want (the same as the one generated by the menu system of Joomla) . The system will then use that URL in the categories listing module automatically and you'll have what you want.

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
10 years 1 month ago #206692

Hi Nicolas,

I've tried that but the setting has no effect.

Ian

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
10 years 1 month ago #206714

Hi Nicolas,

I would add that setting the canonical URL for every product I would consider a labour intensive workaround but not a solution.

All I am trying to do is replicate what I did with my old Virtuemart 1 site which you can see here www.artistpapers.co.uk

I have used SH404SEF on that site, but you can see that whether you go via the Shop main menu item or the side bar menu you get the same URL. It just seemed to work.

I can't seem to replicate that with Hikashop whether I use SH404SEF or not.

This is urgent for me now as it's the last problem holding up deployment of the site.

Thanks for your help.

Ian

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 1 month ago #206722

Hi,

To have the same Urls for both main menu and category listing module, you have to select the categories listing menu in the "menu" option of your categories listing module.

Else as Nicolas said, thanks to the canonical urls you will have the desired behavior, you can use the option to auto fill the canonical url if not existing and then navigate through the product pages from the desired menu (with the correct url) and the canonical urls will be automatically filled.

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
10 years 1 month ago #206838

Hi Xavier,

As per my original post...

I have specified the "Shop" menu in the category listing module but it doesn't generate the same URL's
As I have also already said, setting Hikashop sef to use the canonical URL also has no effect

I've been on this all day going round in circles and I'm stuck.

Ian

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
10 years 1 month ago #207117

Any more thoughts on this?

More info ....

The content module doesn't like nested menus, so if I set the Use Menu option to "Shop" any link from the content module will always go to the shop home page, even if it's a subcategory of shop.

The content module seems to use the page header text rather than the alias text for insertion in the URL

I am actually not seeing canonical URL's generated which may be why the force canonical URL option isn't working.

Ian

Please Log in or Create an account to join the conversation.

  • Posts: 117
  • Thank you received: 3
10 years 1 month ago #208199

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
10 years 1 month ago #208262

crealiagroup, no solution from Hikashop, it seems the content module just doesn't generate ideal SEF URL's

I've worked around it in two ways...

1) I've copied the html generated by the content module (the grey sidebar in my screenshot) edited it to correct the URL's and pasted that into a custom module. Because I'd kept all the classes the custom module looks exactly the same, only issue is it has to be updated manually but that won't happen too often with my shop.

2) I also had some other hikashop generated links that weren't "right" so I've used rewrite rules in .htaccess, in particluar hikashop was generating URL's like shop/category/my_category when I wanted shop/my_category
To get rid of the surplus word category I used this rewrite rule...

RewriteRule shop/category\/(.*)$ /shop/$1 [R=301,L]

It's not ideal but it does the job. Hopefully Nicolas and the team can look at making their SEF a bit more SEF like!

Hope this helps,

Ian

The following user(s) said Thank You: crealiagroup

Please Log in or Create an account to join the conversation.

  • Posts: 117
  • Thank you received: 3
10 years 1 month ago #208265

Please Log in or Create an account to join the conversation.

  • Posts: 84233
  • Thank you received: 13673
  • MODERATOR
10 years 1 month ago #208281

Hi,

The solution I gave 2 weeks ago will do the job.

You said

I am actually not seeing canonical URL's generated which may be why the force canonical URL option isn't working.

But that's not linked to the issue since I told you:

in each category, you can fill in the "canonical URL" field the URL that you want

You should not let the system generate the URLs of the categories but you should enter yourself the URL you want in the canonical URL field. Then, the listing module will use these URLs, matching your menu structure.
That's what both Xavier and I said from the beginning.

Also, the "category" text can be changed thanks to the "category SEF name" setting of the HikaShop configuration. But that's a moot point if you set your menu items URL as canonical URLs.

Please Log in or Create an account to join the conversation.

  • Posts: 117
  • Thank you received: 3
10 years 1 month ago #208315

Hi Nicolas,

we've checked again the configuration described by you an Xavier without success anyway. What could be wrong?
Our modules show products with urls like: www.mysite.com/shop/my-product-sef-name (here we have associated the menu "shop")

meanwhile the url with the main navigation menu is:

www.mysite.com/shop/categorysef1/sub-cat.../my-product-sef-name (take a look at the entire link)

Something misconfigured?

Last edit: 10 years 1 month ago by crealiagroup.

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
10 years 1 month ago #208329

Hi Nicolas,

Manually setting the canonical URL using the admin interface for every category and product would take forever and be error prone. I will be setting the canonical URL's in time because I want that meta tag there, but it would be far preferable if Hikashop generated sensible SEF URL's in the first place.

Regards,

Ian

Please Log in or Create an account to join the conversation.

  • Posts: 84233
  • Thank you received: 13673
  • MODERATOR
10 years 1 month ago #208382

Hi,

@crealiagroup:
Can you confirm that you entered the URL www.mysite.com/shop/categorysef1/sub-cat.../my-product-sef-name in the "canonical URL" field of that product and that you have the "force canonical URLs on listing" setting turned on as I recommended ?
If that's the case, then the only possibility left is either that you have caching on your frontend preventing you from seeing the change, or that you have some custom code in the files of the product view not taking into account the canonical URL (as it would happen with the old versions of the files of the product view with old versions of HikaShop were that didn't exist)

@iedwards:
The system can only generate URLs with the knowledge it has. When there are several ways to generate a URL to a product page (from different menu items, modules, etc), the system cannot choose which one is the one you want. So it just take the first one. It would be preferable yes, but I don't see a way to do that automatically. Intrinsically, the problem is that with Joomla you can create different URLs to access the same page. That's what lead to this situation.

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
10 years 1 month ago #208423

Hi Nicolas, thank you for the reply.

There is only one correct way to generate a good SEF URL and that is to use the hierarchy catgory\subcategory\products (see Google's SEF guidlines) and I was unable to make the Hikashop content module do that. For some reason you either have to have the word "product" or "category" in there somewhere and at times I was getting an odd category id at the end of the URL (depending on settings which I forget now). If the settings would let you turn those additional elements off then we would be getting somewhere!

Ian

Last edit: 10 years 1 month ago by iedwards. Reason: clarification

Please Log in or Create an account to join the conversation.

  • Posts: 84233
  • Thank you received: 13673
  • MODERATOR
10 years 1 month ago #208512

Hi,

The URL you want (when I say you, I mean the merchant) is not necessarily the same as the "good SEF URL" of Google SEF guidelines.
For example, some merchants don't want the category hierarchy but directly the product name in the URL.
HikaShop will generate the URLs based on the way you configured the menu/module/sef settings and it tries to do the best possible to take into account the way you configure it and the limitations of the SEF system of Joomla.
The "product" and "category" words can be changed/removed with the "SEF product/category name" settings of the HikaShop configuration, as explained in my previous message.
The ids can also be removed with the "remove category and product ids from URLs" setting at the same place in the HikaShop configuration.

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
10 years 1 month ago #208519

Hi Nicolas,

Thanks again for the reply.

Yes I can see you can remove "category" or "product" from the URL, but not both. That's the problem.

Not to worry, I've worked round it and got what I wanted but it's cost me a lot of time, I was just hoping you'd take this on board as a reasonable customer requirement for future versions.

Best regards,

Ian

Please Log in or Create an account to join the conversation.

  • Posts: 84233
  • Thank you received: 13673
  • MODERATOR
10 years 1 month ago #208524

Hi,

I would love to take that into account.
Unfortunately, if we allow you to remove both, then the router is not capable of distinguishing between a category and a product URL within the constrains of the SEF system of Joomla.
That's why we added an option for them and a check.
So I don't see a solution to do what you want for now while still conserving all the functionalities available.

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
10 years 1 month ago #208570

OK but if I manually construct a joomla menu using the category hierarchy joomla gives me a SEF friendly URL (without any extra data) so maybe a different approach would be for the hikashop content module to generate a joomla menu, save having to do it manually?

It would also be useful if there was a "menu" view in the component so that if I wanted to add a "Shop" link on the main Joomla menu I could do it without having to build the whole thing by hand by adding categories.

Sorry to keep going on about this but it's something that worked automatically with my old site but has caused me great difficulty with this one.

Regards,

Ian

Please Log in or Create an account to join the conversation.

  • Posts: 84233
  • Thank you received: 13673
  • MODERATOR
10 years 2 weeks ago #210261

Hi,

Yes, when you have one menu item for one category with the menu item tree matching the category tree, you can get what you want.
Having them synchronized automatically so that you don't have to do it manually would be great indeed.

That's not impossible to do but will require some complex coding because you also need to manage all the settings of all these menu items. You don't want to have to configure each menu item manually to change the number of columns, etc. The other issue is that the Joomla menu manager doesn't have any trigger for us to plug into it and HikaShop wouldn't know if you would delete one of the menu items, or change it.
So it's not just about generating them but also what to do to configure them all easily.

The real issue is that the Joomla menu system is not adapted to do that.
The best would actually for it to have some triggers so that we could dynamically add virtual menu items to it on the fly when the page is generated. But there is not such mechanism.
So what we did is to have the possibility to configure a category listing module which can achieve that display of the categories in a module in a look alike manner, but we're limited by the SEF system and can't propose the exact URLs you would like because of that.

In short, yes that's possible, but not easy to do that automatically with Joomla. We're doing our best to make it as easy as possible while still providing enough flexibility for most users.

Please Log in or Create an account to join the conversation.

Time to create page: 0.195 seconds
Powered by Kunena Forum