Using page description (if available) instead of first block

Permalink Browser Info Environment
Hi,

I was wondering if there's a way to customise the template so it uses the page description instead of the first block when ones available? Basically would like to use the page block excerpt as a fallback when users haven't added a page description.

Great add on by the way... find myself using it all the time.

Type: Discussion
Status: New
morphfilms
View Replies:
jordanlev replied on at Permalink Reply
jordanlev
Hi,
Yes, this is very easy to do (it's how the built in page_list block does it)... just override the template file by copying this file:
SITEROOT/packages/page_list_teasers/blocks/page_list/templates/teasers.php

...to here:
SITEROOT/blocks/page_list/templates/teasers.php

Then modify that copied file and change this line:
$teaser = $plth->getPageTeaser($page, 'Main', $teaserBlockCount, $teaserTruncateChars);

...to this:
$teaser = $page->getCollectionDescription();


Cheers,
Jordan

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.