Inefficient toString() implementation in ContentPlaceholder implementations

Description

When the $include.page placeholder has been changed to return a ContentPlaceholder (), we had to implement toString() on all ContentPlaceholders in such a way that $include.page(...) returned the rendered content in order to stay compatible with existing themes.

However this has the drawback that such content objects are also being rendered when adding velocity 'null checks' in a template, for example:

1 2 3 #if ($page.next) $page.next.link #end

In this example we only want to know if there is a 'next' page and we're not interested in the content at all. We should revert the toString() implementation and let $include.page() return a wrapper that implements toString() by rendering the content.

Environment

None

Status

Assignee

Maximilian Hilbert (K15t)

Reporter

Jens Rutschmann (K15t)

Labels

Participants

None

Deployment

None

Components

Sprint

None

Fix versions

Priority

Major