Being able to target a Model record and its specific field ( including expanded modular content) would be awesome.
My use-case is pretty simple. We have a preview mode where we can highlight components reflecting the DatoCMS Blocks, or fields. We would like to direct link to these blocks in page context within DatoCMS back-office.
This feature would improve a lot authoring experience.
Regarding another feature request I’ve made, this one would match perfectly with it.
We’ve heard this request a few times, and I hope it will get implemented!
In the meantime, just as a workaround:
We have an undocumented feature that might be able to do what you want… with some caveats.You can use append a URL parameter after the /edit link like #fieldPath=multiple_blocks.0.nested_block_multiple.1.example_field and that will point you to a specific field and highlight it. For example:
This is an undocumented, unofficial feature and may change in the future
It’s not super easy to figure out the exact fieldPath for a given modular content field/sub-field. It basically goes fieldName.nestedBlockNumberStartingFromZero.fieldName. You can also make a simple DatoCMS plugin and use the ctx.fieldPath prop to retrieve that (Edit: Actually, it’s pretty easy now! See next post about using the inspector).
@roger , reading the documentation, this feature request is something “similar” to Vercel Content Link with a much more custom approach on linking from frontend ?
Yes, the in-page anchors and #fieldPath help support that feature, but there’s more that goes into Vercel Content Link than just that (as described in the article).
Nonetheless, it’s a useful, albeit unofficial, way to jump directly to a field even without Content Link.
@samuel.bichsel It’s not returned in the GraphQL endpoint because it’s just a frontend function that targets certain kinds of fields, not something that works with GraphQL. You can look them up manually the browser inspector (Deep linking to fields - #3 by roger), or they’re really just the API model names you give each model. Is that what you’re asking, or did I misunderstand?
Yes, we realized that they are just the API model names. We are trying to link directly from the draft website to the fields in Dato, that should be possible like that. Thanks @roger!