You can find my original use case for inline blocks to avoid having to create a whole separate model for links with custom attributes or links to other records in Dato here.
I was finally getting around to leveraging the inline blocks and seemed to bump into a relatively big blocker for using it. I wanted to raise this issue to understand if this was expected and whether the requested functionality of referencing an inline block from the link menu or at least treating it like a link could be considered, which I think would be the most common use-case for this feature.
Before Inline Blocks
- Let’s say i want to be able to create a link and instead of manually specifying key-value custom pairs for the link, I want to be able to associate the link with a category within Dato
- I would create a Custom Link model in Dato with two fields, URL (single line text) and Category (single Link to the Category model)
- I add the Custom Link model as a supported inline record for the structured text field on the blog post
- Where i previously had a link with link text, my landing url, and some manual metadata, I could click on the link, open the Link Menu, then select “Link to DatoCMS Record”, then create my Custom Link record
After Inline Blocks
- (same as before)
- Instead of Custom Link model, I instead create a Custom Link block
- I add the Custom Link block as a supported inline block for the structured text field on the blog post
- Where I previously had a link with link text, my landing url, and some manual metadata, I could click on the link, open the Link Menu and (Issue #1) there is no option for an inline block from the Link Menu
(Issue #2) Inline Block Replaces Text
- You can’t select an inline block in the Link Menu
- Ok, well let’s just try to delete the link and try adding the inline block another way
- Let’s select/highlight the text where the link was before
- Next, we click Insert → Add Inline Block → Custom Link
- Next, we enter the Landing Url and select the Category
- Next we click Back to Record
- That adds the Inline Block where the link was before, but now there is no Link Text and we’ve lost the text that was highlighted
Questions
- Is there any expectation to add inline blocks to the Link Menu?
- Or, is there a way to get to the link text that is being replaced by the Inline Block and have that added to the Inline Block?