Skip to content

Shorthand if/else doesn't work with pagination #3980

@nickebdon

Description

@nickebdon

Bug Description

Using the shorthand if/else statement does not work when used with pagination, however the basic if/else does.

How to Reproduce

This doesn't work:

{{ collection:work limit="8" paginate="true" as="posts" sort="date:desc" }}

    {{ posts }}
        <p>{{ short_title ? short_title : title }}</p>
    {{ /posts }}

    {{ paginate }}
    ...
    {{ /paginate }}

{{ /collection:work }}

However, this does:

{{ collection:work limit="8" paginate="true" as="posts" sort="date:desc" }}

    {{ posts }}
        <p>{{ if short_title }} {{ short_title }} {{ else }} {{ title }} {{ /if }}</p>
    {{ /posts }}

    {{ paginate }}
    ...
    {{ /paginate }}

{{ /collection:work }}

Extra Detail

Environment

Statamic version: 3.1.27

PHP version: 8.0.8

Install method (choose one):

  • Fresh install from statamic/statamic

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions