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

Find a way to display contained content items #2688

Closed
sebastienros opened this issue Nov 15, 2018 · 6 comments · Fixed by #5665
Closed

Find a way to display contained content items #2688

sebastienros opened this issue Nov 15, 2018 · 6 comments · Fixed by #5665
Milestone

Comments

@sebastienros
Copy link
Member

Generic way to route bag part items, or taxonomy terms.
Might be resolved with custom routing templates, with a generic routes handling bag parts, and another one handling taxonomy terms.

Example:
Landing Page has an autoroute, let's say /foo/bar. The autoroute part would register this route. But the BagPart module could also register a route like /foo/bar/projects/{project_slug}

@sebastienros
Copy link
Member Author

The Autoroute part could have some logic to navigate the Json document to the root, and each time the parent also has an autoroute it would append it to the final route and add a special routedictionary controller on how to find the correct node (main content item id + json path to inner one).

Ultimately any contained content item would be routable if it had an autoroute part. The editor would also be clever enough to show the base prefix leading to it.

@sebastienros
Copy link
Member Author

I managed to get it to work with Taxonomies on the sebros/routable branch. It's not super neat, as I didn't want to break the Autoroute part, but some concepts are overlapping between Routable and Autoroute.

It's still work in progress, and we might need to break Autoroute to get a better implementation.

@agriffard
Copy link
Member

What was the progress on this one?

@sebastienros
Copy link
Member Author

For taxonomies, a generic solution would be to create an action that takes a taxonomy id in one of the url segments, like /taxonomies/4abcdefgh123/colors/blue

@deanmarcussen
Copy link
Member

deanmarcussen commented Nov 22, 2019

I quite liked the concept in sebros/routable

but I think it could integrate with autoroute (without breaking)
if autoroute always took a jsonPath, then if it was at the root great, if if was at a contained item, also great. (and if the jsonPath null, assume it was at the root - non breaking)

The challenge would be to call the autoroute handler when adding / creating bag items and taxonomy terms.

Possibly a ContainedContentManager could be used instead of the ContentManager to get the difference in behaviour.
Then handlers could still be invoked (or a subset that makes sense for contained items)
With a flag on the context's for contained or standalone.

Advantages are you'd also get publishing dates, and other metadata which is missing (and slightly annoying sometimes when you want it) on contained content items.

@sebastienros
Copy link
Member Author

How to route taxonomies:
From a discussion with @deanmarcussen @Skrypt @agriffard @daveblack101

Razor Page
For taxonomy /taxonomy/{id}/{*text}
/taxonomies/1234556787888/categories
/taxonomies/categories/1234556787888/

For term /taxonomy/{id}/{termid}/{*text}
/taxonomies/categories/science/biology/1234556787888/2342424234-2342424234
/taxonomies/categories/science-biology/1234556787888/2342424234-2342424234
/taxonomies/1234556787888/2342424234-2342424234/categories/science/biology

For taxonomy
/taxonomies/categories

IHandlerAspect to extract the alias (AliasPart provides one value) and store the value in a specific field of the Term Content Item and Taxonomy. Then used to lookup the term in memory (no query).
Create an index for taxonomies that would store their IHandlerAspect value to query. The default IHandlerAspect provider returns the Id and a slugified display text. If an AliasPart is not provided the urls will look like `/taxonomies/1234-categories/5678-science-technology/9012-biology

For terms (taxonomies/{taxAlias}/{*termAliases}
/taxonomies/categories/science-technology/biology

"Science & Technology"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants