Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Content Type "Alias"?! #60
A content type to choose from a entry of Section B inside a entry of Section A would be very helpful to be more flexible. E.g. having two sections with a structure like this:
A. Pages (multiple)
B. Galleries (multiple)
With this the user could select one of the Gallery Entries on a Pages Entry. This would be very benefical to crosslink contents between different section and to organize them, as well as reuse them in a more efficient way.
@iocron Thanks for submitting this.
In the original draft for Vapid, I had something similar:
The problem I ran into was that it would require some kind of querying mechanism for sections. e.g.,
Still, I think an alias/reference directive would need to support both scenarios: referencing another record and narrowing a subset of records.
I'm curious to hear other use cases you have in mind.
@srobbin Thank you for your feedback. I had something similar in mind, but for simplicity and flexibility I was thinking about a new content type e.g. "alias" (or "reference") so the dashboard user can select one or multiple entries of a section inside another sections entry:
In Addition, referencing only parts of the section with the content type "alias" could be accomplished through a additional parameter (filter="...", similar to your "where" statement) if really needed, e.g.:
The only problem with the "filter" solution I see are regular html tags / wrappers, those are ignored, if we have something like this:
They would need a own section, so the wrapper (div, etc.) are included as well. Another alternative would be DOM Parent Traversal (traversing up the dom tree of the filtered element until it hits the section). Or a implementation of a dom selector, e.g.:
I think this solution gives the user a very modular ability to share / reference content between sections and to organize / split everything for a better overview / structure of the backend (the "filter" / where parameter would be only optional, the mentioned solution without the "filter/where" would be already great).
I see many use cases especially in Blogs / Blog Archives, Crosslinked Categories / Crossselling, creating a own section "Filemanager" for managing the images and just referencing them in other sections, custom SEO Implementations (canonical, etc.), shared Galleries, multiple views on different sections (by using filter=...), independent Navigation Trees, etc.. The possibilites are endless :)
I hope I was able to explain it well enough.
Hey! This is a great idea and would make vapid incredibly powerful. I asked a similar question in the forums here: https://forums.vapid.com/t/data-linking-is-it-possible-to-associate-data-in-multiple-places-conditionally/179
I think @iocron's idea is a good one, but unfortunately it's out of my realm of expertise to try and put a PR together for this.