-
-
Notifications
You must be signed in to change notification settings - Fork 8
Omit host in entry link urls #339
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
Comments
You absolutely shouldn't need to find-and-replace anything. While we could use the relative URL to the element, that's not going to work if the URI to that element changes (like the slug is changed). When you select a link to an entry or other element, we record a reference to that element and it's site. Something like: This is similar to what other rich text fields like CKEditor do. Is that not what the value of a link looks like in your editor? I'd need some information about the Vizy version you're on. |
You're absolutely right about the entry uri changing and causing the same issue, hadn't thought about that! We're usually keeping Vizy pretty up-to-date. In the project where we noticed the issue, the version is 3.0.7. To answer your question, no. After changing the site url in the site settings, we noticed that Vizy entry links still point to the old site url, when the link was created. You're saying it should have been updated automatically when we changed the site url? |
What we see is pretty much what you have in the screenshot. For example:
Does that help you? |
Hmmm, let me do some testing. But - you mention GraphQL, is that something you're using? If so, can you respond with your query? I only as because if you're using Part of the link handling is the fact that while the URL may be incorrect (and always will be until you change the link), so long as it retains the site and ID of the related entry, Vizy will replace the URL shown in the raw editor content with the correct "live" URL. |
Yes we're using Craft as a headless CMS and Graphql for all our queries. Whenever we query a Vizy field, we either use the Here are some query examples: {
entry(id: "3008", site: "fr") {
... on article_Entry {
articleRichText {
nodes {
... on VizyNodeInterface {
html
}
... on VizyBlockInterface {
type
blockTypeHandle
}
... on articleRichText_superquote_BlockType {
quote
authorName
role
}
... on articleRichText_accordion_BlockType {
proseDrawers {
... on proseDrawer_Entry {
uid
displayTitle
inlineRichText {
renderHtml
}
}
}
}
}
}
}
}
} Or simply {
entry(id: "3008", site: "fr") {
... on article_Entry {
articleRichText {
renderHtml
}
}
}
} Note that we never render inline links ourselves, we always rely on Vizy's rendered html for that. The only reason we use |
Sorry didn't mean to close |
Great, thanks for confirming - looks like you're doing that all correctly. So I can confirm on my end that the links are rendered correctly, and return their dynamic state (if the slug of the entry changes, if the section URL structure changes, if the site base URL changes). I don't suppose it's anything like cached GQL queries or something? I'll have to investigate further! |
What are you trying to do?
I work for a web agency and our usual setup for clients involves changing the Craft sites base urls as part of the production process.
Our problem is that when a Vizy entry link is entered, its url is not updated after we change the Craft site's base url. I understand that this is because the field value is stored as JSON in the database.
What's your proposed solution?
We would like for entry link urls to only have the path of the url, not the full one (
/en/about
instead ofhttps://qa.client-site.com/en/about
). Is it possible to add an option for this?Another alternative, though less desirable, would be to have a way to update the links when a Craft site url changes.
Additional context
No response
The text was updated successfully, but these errors were encountered: