DigitalCommons / sea-wordpress-theme

0 stars 1 forks source link

Upgrade Case Studies block #6

Open ColmMassey opened 3 years ago

ColmMassey commented 3 years ago

Make the case studies management more flexible.

ColmMassey commented 3 years ago

Notes feom conversation with Adam:

If one wanted to display the contents of one of the Case Studies at the bottom of a newly created page, is there an easy way of doing this, or would it require coding a new block?

Unfortunately as far as I know there is not a way to do this. The case studies block has no configuration options for a specific instance, only globally.

Similarly, can one configure an IN OUR OWN WORDS block (which by default displays the most recent 3 case studies), to display different #s of case studies, or to specify which ones to add, or again would that require coding a new block?

Currently this number is hard coded (here: https://github.com/SolidarityEconomyAssociation/sea-wordpress-theme/blob/f93a85465856ae58a95f19fb3968f46d3d71f026/inc/blocks/case-studies-links.php#L4)

We had some discussion in the issue thread about this (here and here), and ended up setting the case studies page to use the limit set by the "Site options > Case studies per page" parameter, but left the home page block at 3. This would be easy to change by replacing this line with this one.

It may be that in the future it would be worth considering adopting a more flexible approach to displaying lists of case studies (there are plugins that would allow you to display an arbitrary number using a shortcode, while including a custom template from the theme, for example).