You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently launched a site for a semi-annual event using Contentful. One of the content types I set up was for the event itself, and it contains fields for event-specific information like registration deadlines, fees, venue location, etc.
The Problem
There are several places on the site where pertinent information pertaining to the event is displayed inline, mid-sentence. But the way inline embedding works, you can only choose the entire record to embed -- once you get to the point of parsing what's been embedded using the renderer package, there's no context for what field you intended to display. Given this fact, I don't really understand what the use case is for inline embedding, unless you were to make a content type for each type of information (ex. price or date), which to me seems like a convoluted workaround. (To be clear, I think it makes perfect sense for block embedding to work the way it currently does.)
My Current Workaround
What I ended up doing to get around this issue -- and it's super hacky and not at all globally applicable -- is to write the label of the field meant for embedding inline and then underline it. Then using the renderer, I look for the underline mark, convert the label to camel-case, checking for a matching field, parse it based on what field it is (date fields are all named uniformly so I can tell what's a date, for instance), and if there's no matching field, just leave it alone. It works, but it's not a great solution as it assumes the intended record.
How It Should Work
In the interface, once you've chosen a record for embedding inline, the next step would be a list of fields for inclusion. The API would return exactly the same payload, except with the inclusion of something like selectedField so as not to introduce breaking changes, while giving developers the proper context.
The text was updated successfully, but these errors were encountered:
Background
I recently launched a site for a semi-annual event using Contentful. One of the content types I set up was for the event itself, and it contains fields for event-specific information like registration deadlines, fees, venue location, etc.
The Problem
There are several places on the site where pertinent information pertaining to the event is displayed inline, mid-sentence. But the way inline embedding works, you can only choose the entire record to embed -- once you get to the point of parsing what's been embedded using the renderer package, there's no context for what field you intended to display. Given this fact, I don't really understand what the use case is for inline embedding, unless you were to make a content type for each type of information (ex. price or date), which to me seems like a convoluted workaround. (To be clear, I think it makes perfect sense for block embedding to work the way it currently does.)
My Current Workaround
What I ended up doing to get around this issue -- and it's super hacky and not at all globally applicable -- is to write the label of the field meant for embedding inline and then underline it. Then using the renderer, I look for the underline mark, convert the label to camel-case, checking for a matching field, parse it based on what field it is (date fields are all named uniformly so I can tell what's a date, for instance), and if there's no matching field, just leave it alone. It works, but it's not a great solution as it assumes the intended record.
How It Should Work
In the interface, once you've chosen a record for embedding inline, the next step would be a list of fields for inclusion. The API would return exactly the same payload, except with the inclusion of something like
selectedField
so as not to introduce breaking changes, while giving developers the proper context.The text was updated successfully, but these errors were encountered: