Quantcast
Viewing all articles
Browse latest Browse all 13

Add image from Files to description in RSS (using kirby3-feed)

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;
  }
}

Read full topic


Viewing all articles
Browse latest Browse all 13

Trending Articles