Skip to content
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

Support Inlined Relations #2076

Closed
Undistraction opened this issue Feb 9, 2019 · 1 comment
Closed

Support Inlined Relations #2076

Undistraction opened this issue Feb 9, 2019 · 1 comment

Comments

@Undistraction
Copy link
Contributor

Undistraction commented Feb 9, 2019

Is your feature request related to a problem? Please describe.
Currently we can use the relation widget to define a relationship to one or more other entries, but there is no way to edit that relation inline.

Describe the solution you'd like
I'd like a second kind of relation: one that can be edited inline. This would allow a relation to appear to someone using the CMS to be a part of the current entry, but be stored in a separate collection, with only a reference to that relation stored for that entry.

Example
I have a complex site which uses a Page Collection to define standardised information about a page - it's title, metadata, slug etc. However, each page also has other information that needs to be included that is specific to that page, for example a list of FAQs for the /faqs page, a list of slides for the front page, a list of staff members for the about page, etc. There is also often less clearly defined sets of data needed for a page that can easily be described by a block of JSON or YAML, but crucially is different for each page. For an SSG like Gatsby, it is crucial that a set of related items adhere to the same set of fields so that it can generate a schema that is common to all.

At the moment, the only option available is to create new collections of data that are - to anyone editing the page entry - unclearly related to the page itself. By allowing a relation to be made editable inline - effectively expanded within the entry page, this relationship could be made clear. It would also allow different pages to include different shaped data - because it would only be defined by a relation or set of relations.

Pseudocode example

So the following set of fields:

Page

- name
- slug
- title
- additionalData (relation)

Page-specific-data

- IntroText
- faqList
- formTitle

Would be expanded in the editor to

- name
- slug
- title
- additionalData (relation)
   - IntroText
   - faqList
   - formTitle

Describe alternatives you've considered
The only real alternatives at the moment are to create separate unrelated collections or individual files that are pulled in and associated with a page at build time (the relationship is therefore unclear to anyone editing the data), or to create the same set of fields on all pages, but only use them where needed (this is very unwieldy, doesn't scale and results in lots of confusing and unused fields for most entries).

Additional context
I think it's important to look at this from the perspective of someone who isn't a programmer editing content in the CMS. They would expect all the content within a page to be editable from within that page which is currently only possible on simple pages where the page content can be defined as markdown in its body. As soon as structured data is necessary this is impossible.

@erquhart
Copy link
Contributor

erquhart commented Feb 9, 2019

Definitely agree, this is a long-standing request with complex requirements, but it's definitely on the roadmap.

Closing as a duplicate of #192, please comment there if more details are needed.

Sent with GitHawk

@erquhart erquhart closed this as completed Feb 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants