Skip to content

ro-ka/kirbytag-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 

Repository files navigation

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');

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages