Open tobidemski opened 1 year ago
no it's not a bug, you need to reference its mimetype
How can I reference its mimetype for an asset? Thats the overlay for link embed:
If you choose an asset it will always rendered with the SDK as an image instead of a link with an image in it. I haven't found a way because of the condition I refered.
Can you give me an example what you mean?
Thanks!
For you to do this;
You will need to head onto the schema view and then go to the model your Rich Text field is on and click "Edit field" on it :) That's where you can enable embeds
Once that is enabled, you can use the embed option on the editor when editing your content entry. That option is under the "Link" icon on the toolbar of the editor.
I hope its helps
Im not speaking about the hygraph UI but from the head application (in my case nextjs). I know how to configure the embeds etc. but Im using this SDK which does not work as expected because if you use an asset in a link embed its not rendered like this. This means you can never have an image (referenced through an entity) with a link.
it's a bug on the lib not the UI
@jpedroschmitz I'm struggling to insert the link to a word on rich text , when I click on this the field doesn't; respond, can anyone tell me why that is happening?
@jpedroschmitz I'm struggling to insert the link to a word on rich text , when I click on this the field doesn't; respond, can anyone tell me why that is happening?
Its looking like a different issue. Better create an own issue for that. But as I can see on your screenshot you havent set a "Link address" and only a placeholder text is shown. Also you got an error message "Please enter a valid URL". I would assume if you want to set a link you also should set an actual link in the "link address" field because its required.
@jpedroschmitz I'm struggling to insert the link to a word on rich text , when I click on this the field doesn't; respond, can anyone tell me why that is happening?
Its looking like a different issue. Better create an own issue for that. But as I can see on your screenshot you havent set a "Link address" and only a placeholder text is shown. Also you got an error message "Please enter a valid URL". I would assume if you want to set a link you also should set an actual link in the "link address" field because its required.
@tobidemski thanks for your response , I'll surely create a new issue for this , yes I can see that warning but the problem here is that I can't populate the data on the input URL field , this isn't taking the data.
Hello,
I tried to link an asset (in my example image) with link embed but its getting rendered as an asset / image instead of a link. I checked the code and found the following line: https://github.com/hygraph/rich-text/blob/9e1a163dfb7d7f1adfc2faa35106a0e9db8fa6ce/packages/react-renderer/src/RichText.tsx#L147
There is a condition on type link if its not an asset. Therefor it is not possible to reference an asset in link embed.
Is this a bug or how does this work? As per documentation it should work to reference assets in links: https://hygraph.com/docs/api-reference/content-api/rich-text-field#embed-assets
Hope you can help me out :)
Best regards Tobi