Related Pages
vsalvino opened this issue · 1 comments
A common feature on most blog posts, is a section on the page showing other related blog posts, usually by category.
In that spirit, we need an out-of-the-box related pages feature. This should generically work on all CoderedPage
, and have the ability for developer/editor overrides, similar to how get_index_children()
works.
- Related page query model will be siblings. However the developer can change this by setting
related_querymodel
. Any other special variables should also begin withrelated_*
- By default, related models will sorted by greatest number of matching/shared/intersection ClassifierTerms. Then sorted by whatever the sibling's parent normally sorts on.
- Lastly, the CoderedPage will have a setting (under LayoutTab), to prefer related pages based on specific ClassifierTerms (similar to "Filter child pages by" setting).
A second related feature, is the ability for a CoderedPage
to render a preview of itself. We should probably avoid the terminology "preview", "snippet" etc. because these are wagtail terms. Perhaps name this "mini view" or something. The miniview should be a simple HTML template, set on the model variable mini_template
or similar, designed to be overridden by the developer on each model. This functionality is similar to search_template
. A default one could be included with CoderedPage showing a bootstrap card with:
- Title
- Cover image
- Body preview
Lastly, our current "Page Preview Block" should be updated to use the preview / miniview functionality of the chosen page. The form template of this block should be moved to the CoderedFormPage
abstract model, and the article template moved to article page, and so forth. Although the ability to choose templates should continue to exist for backwards compatibility with existing sites. Also for backwards compatibility - if the chosen template does not exist, fall back to the page's miniview.