I’m working on an admin interface, where admin users log in to desk content for their newspaper’s mobile app. My scenario is pretty specific, so bear with me;
I have a collection of items. Items are sorted on priority (PN), set by the admin user. Most of the items are “normal”; they are responsible for referring to one piece of content (an article, for instance), or holding on to some values input by the admin user.
Then there are these special items that are configured so that they refer to another collection – a collection that will be embedded and flattened into the collection itself, when rendered by the end user/consumer. The items from the referred collection will have their own priorities pre-set, and distributed by a step value (SN).
To ‘illustrate’:
Collection, sorted on priority (admin user)
Item P10
Special item P15 S10
Item P20
Item P30
→
Becomes the resulting collection (end user)
Item P10
Special item P15+(S10*0) P15
Item P20
Special item P15+(S10*1) P25
Item P30
Special item P15+(S10*2) P35
Special item P15+(S10*3) P45
Special item P15+(S10*4) P55
What I already have
- This all works on the back-end
- A separate preview mode – I can just ask for the collection rendered out as if I were an end user
What I want
- Shadow elements rendered out into the collection when in admin mode, to show how a special item’s referred collection’s items will merge into and spread out into the collection at hand
To clarify, since there have been some confusion in other channels:
I don’t have two collections. I have one collection, and one or more of its items could have configuration that will eventually, for the end user, lead to more items being mixed into and distributed in that one collection.
With Backbone (and Marionette), I know how to add specific types of children into a collection, and how to strip those away when syncing to server. My question is more about how to keep everything in sync when an admin user changes priority or step values, and how do I make all the added rendering efficient?
How would you go about doing something like this?