Problem/Motivation
Once we have #3617664: add an API for prev/next entity, we could *RADICALLY* change how this module works to being API first.
To explain:
Currently, the entity pager is a specially-themed view. We define a custom Views style plugin, and that defines our theme template 'entity_pager' as the theming for that style. We use the Views block system to show the pager. By the time our code is involved, the view has already been executed. This makes things like #2870646: Option hide pager if record only one or zero tricky.
Instead, we could define a custom render element for the pager. This would take the view ID and display ID as properties. This render element would then be in charge of executing the view, and getting the data it needs from the view's result. We'd still store settings on the view's style plugin, but we'd no longer rely on the theming of that -- the view would just be used as a data source. The render element would have similar theming to the Views style -- it could pretty much use the same template. The block we provide would change to being a completely custom block plugin, which would render the pager element.
I am not sure if this is a good idea or not -- still pondering, opinions welcome.
Comments