I’m trying to do this very same thing but am hitting a wall. I’m unsure how to combine the default text
with the $page->file()
in a format that the feed plugin wants (a field object, I guess?).
My PHP is super rusty. Am I missing something really basic?
class EntryPage extends Page {
public function text() {
$formattedImage = kirbytext('(image: ' . $this->file()->filename() . ' width: 400 srcset: [200, 400, 600])');
$unalteredText = parent::text();
// Combine $formattedImage and $unalteredText somehow.
// $textWithImage = ??
return $textWithImage;
}
}