Fixed
Pinned fields
Click on the next to a field label to start pinning.
Details
Assignee
Joel WatsonJoel WatsonReporter
Luis MajanoLuis MajanoFix versions
Original estimate
Time tracking
No time logged3h remainingComponents
Priority
Blocker
Details
Details
Assignee
Joel Watson
Joel WatsonReporter
Luis Majano
Luis MajanoFix versions
Original estimate
Time tracking
No time logged3h remaining
Components
Priority
Sentry
Sentry
Sentry
Created February 12, 2013 at 6:57 AM
Updated April 4, 2014 at 12:19 AM
Resolved April 4, 2014 at 12:18 AM
Related Content: Ability to relate any content object to one or more content objects. In the page or entry managers have the ability to select other entries or pages.
ORM Model
Add to base content the ability to have a relatedContent one-to-many relationship which should point to itself.
UI
On the page, blog and content store UI, add a section or tab where you can relate content to the one you are editing or creating.
It would be nice to say relate and get a nice modal dialog of all Content Objects that are filterable with their types in a column. Then they can search for them, much how we do the linking already via the editors. Then once they select one, we just add a nice row in the UI saying this content is now related to the other content.
CBHelper
Add a new quick method to the the CB Helper to create a list of links to the related content: quickRelatedContent( content )
This should build a list much how we do the categories or archives widget, with those options as well.
Testing!
Related Content Section
On pages and entries add/edit page, a new section should appear in the right sidebar labeled Related Content. It should only be visible if the logged in user has the EDITORS_RELATED_CONTENT permission. If they do not, the a hidden field should still be submitted containing any related content IDs assigned to the content.
When adding related content, the "add" button should open a modal window which displays a searchable, paged list of
all published pages and entries for the site
excluding any related content already selected for the content
excluding the content item itself (if content is not new)
Clicking the select icon should close the modal and insert a new row into the main content page's related content section (hiding the "empty" message if it was there before).
Clicking the red - icon next to the attached related content should remove it from the list.
Finally, if one of the related content items becomes unpublished, it should be shaded pink in the list, denoting that it is unpublished.
Cloning
Cloning should work as expected. If Cloned Target A has 3 related content items, those same 3 related content items should appear on the cloned result.
Deleting
Deleting a content with related content is bi-directional since the content item you're deleting might be a related content item of another piece of content. To test that this works:
Create New Page A
Add related content items
Create New Page B
Add Page A as related content item to Page B
Delete Page A
Open Page B - Related content should not contain Page A
Export
Exporting gets a bit involved since it's possible to have two pieces of content that are mutually related. Originally this caused some deadly recursions, but I think that's squashed. To test exports:
Create Page A
Create Page B
Create Entry C
On Page A, relate Page B
On Page B, relate Entry C
On Page C, relate Page B
Export Page A, and feel free to analyze the results in your favorite json parser (like so: http://json.parser.online.fr/beta/)
It's difficult to fully test that it's successful without importing, so on to the next step!
Import
Presumably, the export, which includes the relatedContent, should be able to restore the full pages/entries, even if we only exported Page A.
So before importing, delete Page A, Page B, and Entry C.
Now try importing your Page A export. If everything works correctly, Page A, Page B, and Entry C should be restored and the relatedContent relationships between them should be what they were before deletion.
Export/Import Scenarios
Obviously, there could be much more exotic interconnectedness--the one above is just one example. Please try out some other non-scripted exports and see if everything appears to work as expected.