The Ghost Themes Developer Hub

Welcome to the Ghost Themes developer hub. You'll find comprehensive guides and documentation to help you start working with Ghost Themes as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

paged

The paged context

Use {{#is "paged"}}{{/is}} to detect this context.

Context
Url
Template
Data
Body Classes

index, paged

/page/2/

index.hbs, tag.hbs, author.hbs

[{post}], {pagination}

.paged

Description

The paged context is set in addition to other contexts whenever you're on the 2nd, 3rd, etc pages of a post list. It is set for the index, tag and author post lists. It is never set on the first page.

Routes

The paged context is set whenever there is a page/:num/ part to the route, E.g. on /page/2/ or /tag/:slug/page/2/ or /author/:slug/page/2/. The structure of paginated URLs cannot be customised at present.

Templates

There are no specific templates for the paged context. The index.hbs, tag.hbs or author.hbs template will be used depending on what other context is present.

Data

Whenever you're in a paged context, you will have access to an array of post objects and a pagination object.

Example Code

The paged context is most useful when detecting contexts using the {{#is}} helper.

For example:

{{#is "tag"}}...{{/is}} will be true when on either the first or any subsequent page of a tag based post list.

{{#is "tag, paged"}}...{{/is}} will be true only on subsequent pages of the post list, not on the first.

And if you want to detect the first tag page, you can nest and negate the is helper like this:

{{#is "tag"}}{{^is "paged"}}...template here...{{/is}}{{/is}}

Note: there'll probably be simpler ways to do this in future, but this does work :)

paged

The paged context