solidus_starter_frontend icon indicating copy to clipboard operation
solidus_starter_frontend copied to clipboard

Trailing slash on taxons

Open fthobe opened this issue 11 months ago • 2 comments

@forkata @benjaminwil

[!CAUTION] Blocks #414

Issue

taxon urls do not respect the url entered in the admin interface

Expected behaviour

Taxons render with the same url they were configured in backend.

Background

The point with the slash remains though:)

Let me throw you this ball: let's assume for a moment that I am right about the backslash stuff (looks great but plays out terrible just like Anna Kurnikova and tennis) what can we do to solve this three issues:

  1. When people migrate to solidus they will either have all urls with a trailing backslash, none having a trailing backslash or any (more or less ietf compliant) mixture of having and not having backslashes (we as also candlescience are trailing backslash only people for example as it reduces SEO mistakes in data entry)

  2. Usually you want to keep or better improve SEO (which usually means touching as few urls as any possible avoiding also changing paths to include /products/ or /t/).

  3. Not destroy performance of url requests.

What can we do to solve for all three migration cases (with / without / mixed) the trailing "/" issue in one go? I'd be totally willing, happy and full of appreciation to hear from you to what we can do to either collaborate on or align about a feasible solution and put @shahmayur001 on it or maybe you come up with a plan that you want to implement by yourself!

Surely we cannot override admin backend behaviour in a route on a starter template as this creates unexpected behavior.

Solidus Version:

To Reproduce

Current behavior

Expected behavior

Screenshots

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

fthobe avatar Feb 08 '25 02:02 fthobe

@forkata do you have some input here? I saw there are some ways on rails to harmonize an instance, what would be your preferred way to have this solved in the starter without breaking canonicals?

Keep following in mind:

  • there are use cases such as google shopping and variants where you want a parameter in the url
  • not everybody uses trailing backslashes consistently

What can we do to maintain full configurability from the backend?

fthobe avatar Mar 09 '25 23:03 fthobe

Hey @fthobe, thanks for spinning this ticket off and clearly outlining the specific issue you have in mind. I agree with the point you make that the starter frontend should respect the taxon path as it has been configured in the backend and render the a canonical URL that respects that. I need to take a closer look at what we're doing currently and come up with a failing test case so we can adjust the behaviour here as that wasn't something that was specifically tested in our changes to remove the canonical_rails dependency.

As far as the trailing slash implementation I don't have a good idea for how we can allow a mixed approach (on a per product/taxon) and I feel like that might be something we leave out of scope for this first iteration, unless we want to add extra database fields to track this on products/taxons, similar to the meta fields. I think always adding a trailing slash or never adding it, even for collection routes, should be something we can allow to be configured. Curious what you think about this approach?

forkata avatar Mar 13 '25 22:03 forkata