Skip to content

Instantly share code, notes, and snippets.

@foleyatwork
Last active December 12, 2015 06:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foleyatwork/4732421 to your computer and use it in GitHub Desktop.
Save foleyatwork/4732421 to your computer and use it in GitHub Desktop.
The featured posts block dynamically pulls in featured posts from any collection with any category filter or tag filter.

Squarespace Featured Posts Block

The featured posts block dynamically pulls in featured posts from any collection with any category filter or tag filter.

Installation

  1. Upload featured.block to your /blocks/ folder.
  2. In any .list, .item, or .region file, add this partial: {@|apply featured.block}

Configuration

  1. You can remove category and tag support by removing those attributes from the squarespace:query tag.
  2. The block currently returns 3 results. You can change that by editing the "limit" attribute in the squarespace:query tag.
  3. There is currently a feature that shows a message if no items are returned. You can change that my removing lines 12 and 13. If you remove that feature, nothing will show up in the markup in the event there are no items returned.

Credits

By: Kevin Foley
I am a Squarespace employee but this Gist is not a supported Squarespace feature. (That doesn't mean it's not awesome :)
Squarespace Query Docs: https://developers.squarespace.com/squarespace-query/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment