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 returns parse_url($this->getUrl(), PHP_URL_PATH) so I can try a PR if that's something you want to implement !
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 !