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

urlPath generation with multisite setups. #274

Open
dopry opened this issue Nov 11, 2022 · 2 comments
Open

urlPath generation with multisite setups. #274

dopry opened this issue Nov 11, 2022 · 2 comments

Comments

@dopry
Copy link
Collaborator

dopry commented Nov 11, 2022

In wagtail I have a site, example.com, setup. The root page is Example located at /example. When I query the pages over graphql they all come back with the urlPath /example/path/to/page. I have code in my frontend that parses /example out of the path for every page to generate links. I kind of understand how wagtail's multisite is supposed to work but don't use it. Is there a way to get grapple or wagtail to return a urlPath relative to the site?

@seb-b
Copy link
Contributor

seb-b commented May 1, 2023

We've also ran into this, it's a bit of a pain to have to filter out home page slugs with next's getStaticPaths. Could a new prop be added to the page interface for a relativeUrlPath? It would return the url path minus the root page slug. Page queries via a urlPath arg already work for relative paths.

A guaranteed relative url would also come in handy for other links in a site, at the moment you only have the option of using the url prop which is absolute or relative depending on the number of sites

@dopry
Copy link
Collaborator Author

dopry commented May 2, 2023

@seb-b We started talking about how to fix this in #306. We would love to have your thoughts there.

@dopry dopry mentioned this issue Nov 20, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants