Usage: {{recommendations}}
{{recommendations}}
helper anywhere in a theme to output a list of recommended sites as configured in Ghost Admin.
recommendations.hbs
to the theme’s partials
folder.
When building a custom template, the recommendation
object contains the following data:
id
: Recommendation ID used to track the number of clicks.url
: The recommended site’s URL. Use the readable_url
helper to make a more human-readable URL.favicon
: The recommended site’s favicon, output as an image URLfeatured_image
: The recommended site’s feature image, output as an image URLtitle
: The recommended site’s titledescription
: The recommended site’s descriptioncreated_at
: The date the recommendation was createdupdated_at
: The date the recommendation was updated{{recommendations}}
helper with the attributes listed below to customize its behavior.
title
) in ascending (asc
) or descending (desc
) order. The default order is created_at desc
(or newest recommendations on top).
limit
, recommendations become paginated. Use the page
attribute to access subsequent pages of recommendations.
@site.recommendations_enabled
to only show recommendations when they’ve been enabled in Ghost Admin. This is useful when adding additional markup that should only be shown when recommendations are enabled:
site.com/#/portal/recommendations
. Let users open the recommendations modal by adding the data-portal="recommendations"
attribute to a button.