Replies: 2 comments
-
Hey, thanks for converting this into a discussion. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Craft prepends the site url to the uri of elements, so just make sure your site url does not contain the absolute path. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'll reopen #123 !
I'm working on a Nuxt website and the built-in component needs a uri for internal links.
But unlike saltymouse in #123 my website is multisite, so fetching the element.slug doesn't give me all the information because all my urls have the language at the root, like https://www.example.com/fr/contact and https://www.example.com/en/contact. element.slug gives me contact in both cases where what I would love is /fr/contact.
The best way to do it would be to return a uri graphql field that is like url with the current site domain removed.
I did a proof-of-concept of a new
uri
field that returnsparse_url($this->getUrl(), PHP_URL_PATH)
so I can try a PR if that's something you want to implement !Beta Was this translation helpful? Give feedback.
All reactions