/kirbytag-pdf

Add a Kirbytag to Kirby CMS to embed PDFs in Text fields.

Primary LanguagePHPGNU General Public License v3.0GPL-3.0

PDF tag for Kirby 2

Add a Kirbytag to Kirby CMS to embed PDFs in Text fields.

Installation

Copy pdf.php inside tags to Kirby’s site/tags/ folder.

Usage

Attributes

  • pdf: Filename of the uploaded PDF.
  • class: Optional class name. The default is pdf.

You can use this KirbyText tag in your text as:

(pdf: my-pdf-file.pdf class: my-class)

This creates the following code:

<object class="my-class" data=".../my-pdf-file.pdf" type="application/pdf">
  <p>
    This browser doesn’t support PDFs. Please download the PDF to view it: <a href=".../my-pdf-file.pdf" title="PDF herunterladen" target="_blank">Download PDF</a>.
  </p>
</object>

Configuration

To change the fallback text, set this in the configuration:

c::set('pdf.fallback', 'Dieser Browser unterstützt keine PDFs. Bitte laden Sie das PDF herunter, um es anzusehen:');
c::set('pdf.fallback_action', 'PDF herunterladen');