coderedcorp / coderedcms

Wagtail + CodeRed Extensions enabling rapid development of marketing-focused websites.
https://www.coderedcorp.com/cms
Other
691 stars 134 forks source link

Related Pages #567

Closed vsalvino closed 1 year ago

vsalvino commented 1 year ago

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.

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:

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.

vsalvino commented 1 year ago

Closed by #568 and #569