cloudscribe / cloudscribe.SimpleContent

A simple, yet flexible content and blog engine for ASP.NET Core that can work with or without a database, supports markdown or html editing
https://www.cloudscribe.com/docs/cloudscribe-simplecontent
Apache License 2.0
335 stars 64 forks source link

Option to add Previous / Next navigation buttons to CMS pages #495

Open CrispinF opened 4 years ago

CrispinF commented 4 years ago

Blog posts already have previous/next navigation buttons. We have also implemented this for CMS pages in a client project where cloudscribe SimpleContent is being used to manage a documentation resource with hundreds of pages in a hierarchy of books/parts/chapters/sections/sub-sections. But this implementation was bespoke. We think there's a case for making this a feature in SimpleContent that could be used in all cloudscribe sites. We think there could be a site setting under Content Settings to enable navigation buttons on pages. Then if this is enabled we think there would need to be a setting on each page to hide the navigation buttons (in our project we had a small number of pages where the buttons were undesirable). We think it should be possible to show the navigation as icons or buttons with text e.g. image And we think texts needs to be localisable. Please feel free to comment or thumbs-up on this issue.

CrispinF commented 4 years ago

We are now reviewing the need to include the navigation buttons at the top and bottom of the content. For small pages this would be annoying but for long pages with a lot of scrolling this would be good (our client on this project wants users to be about to navigate to the next page from the bottom of the content on the current page, as well as the top). Should we provide options to control this per page, or try to automatically detect the length of the page (which depends on device width)?

JimKerslake commented 2 months ago

This was already implemented in a specific customer's site (together with some extra nuance to calculate page height and render the buttons at the foot of the page also, if it's a long page).

So the main issue here is whether to bring it in as a part of the cloudscribe simplecontent offering, or leave it as a bespoke per-customer thing.

If the former, then there would be some additional considerations:

1 - I've a feeling (?) we went direct to the database to infer the next/prev page ordering from the cs_page table in raw Pg-sql. If so that is never going to work in a NoDb context.

2 - in practice it raises some anomalies about pages where it's inappropriate / undesirable to render the buttons, and we never had a very good solution for switching them off, per page. This issue partitions further:

All of the above three wishes have arisen in practice.

Probably they could be covered by three new properties on the page:

and if the first is true then we assume the latter two also true.