Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🦋 on page target (product CTA, tag CTA, layout) change behavior for targets without "/" #932

Open
Tirodem opened this issue Jan 15, 2024 · 2 comments

Comments

@Tirodem
Copy link
Contributor

Tirodem commented Jan 15, 2024

Currently, on layout, tag CTA and product CTA (and any widget link) :

  • if I'm on a CMS page ( {site}/{slug} ) :
    • if my target is /target, the link will be to {site}/{target} , that is OK
    • if my target is target, the link will be to {site}/{target}, that is OK
  • if I'm on a page with another level on URL construction ( {site}/{path}/{slug} ), like cart, or product page :
    • if my target is /target, the link will be to {site}/{target} , that is OK
    • if my target is target, the link will be to {site}/{path}/{target}, that is KO ❌

For exemple, link from product page to CMS page news that is normally on {site}/news will be {site}/product/news and will lead to 404 error.

For now we can bypass the issue by adding 100% of the time the "/" at the begin of the link target, but I think it's better to have the same behavior, either you fill the / or not.

⚠️ Don't make a hard fix will force-adding a "/" in the link construction) otherwise it'll break the links already setted with "/".
What we need to do here is :

  • if the target is slug : link might be {site}/slug
  • if the target is /slug : link might be {site}/slug (beware of the {site}//slug effect)
@coyotte508
Copy link
Collaborator

We can force it in the admin UI, before sending to the backend.

Only allow full URLs (https://externalbootik.com) or urls starting with / are allowed.

It's not complex

@Tirodem
Copy link
Contributor Author

Tirodem commented Feb 4, 2025

@AmadouAgiltoo to check when you have time, I'm not sure it's still a thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants