Unit tests passing.
Regression tests passing.
- Apostrophe’s AJAX filter features for
apostrophe-pieces-pages
now support “Load More” buttons and infinite scroll.
To add a “Load More” button:
- Wrap a new element inside your data-apos-ajax-context element around the content that makes up the current “page” of results. This should not wrap around filter links or the “Load More” button itself.
- Give that new element the
data-apos-ajax-append
attribute. - Add
append=1
to the query string of your Load More button. Example:
{% if data.currentPage < data.totalPages %}
<a href="{{ data.url }} | build({ page: data.currentPage + 1, append: 1 })">Load More...</a>
{% endif %}
To progressively enhance this for infinite scroll, add a data-apos-ajax-infinite-scroll
attribute to the button.
Note that we do this via progressive enhancement of a “Load More” button so that Google can still reach and index all of the pages (SEO).
- Attachment schema fields now respect the new
fileGroup
andfileGroups
properties. IffileGroup
is set toimages
, then only image types (GIF, JPEG, PNG) are accepted; if it is set tooffice
only typical business file types are accepted. Note that we have always rejected files that didn’t appear on the list for either type. You can also specifyfileGroups
as an array. -
fileGroup: 'image'
is now configured by default forapostrophe-images
, as was always intended but incorrectly implemented in the past. - Attachment schema fields now respect the new
extension
andextensions
properties. The former is handy if you only want to allow one extension, the latter if you want to allow more than one. The extensions must be those specified forfileGroups
in the default configuration ofapostrophe-attachments
or your override of it (all lower case; JPEG isjpg
; no period). - The
addDocReferences
migration has been parallelized, as this one-time migration can be time-consuming on a large site. - Broken
less
calculation fixed, thanks to Antoine COMBES.