PHPackages                             mnelson-sg/embed - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mnelson-sg/embed

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

mnelson-sg/embed
================

Embed field for Kirby 3

0382PHP

Since Jul 9Pushed 10mo agoCompare

[ Source](https://github.com/mnelson-sg/sg-kirby-embed)[ Packagist](https://packagist.org/packages/mnelson-sg/embed)[ RSS](/packages/mnelson-sg-embed/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Kirby Embed
===========

[](#kirby-embed)

Embed field for Kirby 3 and 4. Display embeds from various media sites (Youtube, Vimeo, Souncloud, Instagram, etc.) by only providing the url to the medium. Built on top of [oscarotero/Embed](https://github.com/oscarotero/Embed).

[![embed-screenshot](https://user-images.githubusercontent.com/14079751/64260995-163b3380-cf2c-11e9-85dc-77f0b8a79a1f.jpg)](https://user-images.githubusercontent.com/14079751/64260995-163b3380-cf2c-11e9-85dc-77f0b8a79a1f.jpg)

Overview
--------

[](#overview)

> This plugin is completely free and published under the MIT license. However, if you are using it in a commercial project and want to help me keep up with maintenance, please consider [making a donation of your choice](https://www.paypal.me/sylvainjl) or purchasing your license(s) through [my affiliate link](https://a.paddle.com/v2/click/1129/36369?link=1170).

- [1. Installation](#1-installation)
- [2. Blueprint usage](#2-blueprint-usage)
- [3. Front-end usage](#3-front-end-usage)
- [4. License](#4-license)
- [5. Credits](#5-credits)

1. Installation
---------------

[](#1-installation)

> Kirby 3: up to 1.1.0 Kirby 4: 1.1.1+

Download and copy this repository to `/site/plugins/embed`

Alternatively, you can install it with composer: `composer require sylvainjule/embed`

2. Blueprint usage
------------------

[](#2-blueprint-usage)

The plugin provides a `embed` field that you can include in any blueprint:

```
fields:
  embed:
    label: Embed
    type: embed
```

You have access to all providers supported by [oscarotero/Embed](https://github.com/oscarotero/Embed). Please note that I won't include any provider unsupported by this library.

You can optionally limit the allowed provider to one within this list : `youtube`, `vimeo`, `flickr`, `instagram`, `twitter`, `soundcloud`. If any other link is pasted, the field won't request the embed.

```
embed:
  type: embed
  provider: youtube
```

If you are using this field in a structure field, it comes with a built-in preview. You can optionally set `icons: true` (default is `false`) to display some providers logos in this preview.

```
embed:
  type: embed
  icons: true
```

[![embed-icons](https://private-user-images.githubusercontent.com/14079751/311266324-ea26df07-005b-4f70-816d-f0e068da4ba4.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM4ODQxMjYsIm5iZiI6MTc3Mzg4MzgyNiwicGF0aCI6Ii8xNDA3OTc1MS8zMTEyNjYzMjQtZWEyNmRmMDctMDA1Yi00ZjcwLTgxNmQtZjBlMDY4ZGE0YmE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzE5VDAxMzAyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBlNDE0Y2NlY2UwYWQ0NDVlMzFiNGMxNWM3ZGZmYjI4YTdlOGEzNjc0YmJjMzFiYWM5MGRiNDM4ODRlZTVjZWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.7qubz_q6FoNTjph7ChDb7RuCv03G8ep4PuDPVgTCRCM)](https://private-user-images.githubusercontent.com/14079751/311266324-ea26df07-005b-4f70-816d-f0e068da4ba4.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM4ODQxMjYsIm5iZiI6MTc3Mzg4MzgyNiwicGF0aCI6Ii8xNDA3OTc1MS8zMTEyNjYzMjQtZWEyNmRmMDctMDA1Yi00ZjcwLTgxNmQtZjBlMDY4ZGE0YmE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzE5VDAxMzAyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBlNDE0Y2NlY2UwYWQ0NDVlMzFiNGMxNWM3ZGZmYjI4YTdlOGEzNjc0YmJjMzFiYWM5MGRiNDM4ODRlZTVjZWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.7qubz_q6FoNTjph7ChDb7RuCv03G8ep4PuDPVgTCRCM)

The field also has all the `url` field's options, except those which wouldn't make much sense for such a plugin (`default` for example), won't fetch anything in the backstage.

3. Front-end usage
------------------

[](#3-front-end-usage)

The plugin provides a `->toEmbed()` method, which is useful to get all the stored data of the embed (its html code, and a few other informations detailed below).

It also allows you to make sure your embed is successfully synced before trying to access the data:

```
if($embed = $page->myfield()->toEmbed()) {
    echo $embed->code()
}
```

Once you have access to the structured embed, here are the options you will have access to as if they were fields (this comes handy because depending on the provider, some informations might be empty. You can therefore check them with the usual Kirby field methods, like `$embed->license()->isEmpty()`).

```
$embed->title();        // The page title
$embed->description();  // The page description
$embed->url();          // The canonical url
$embed->type();         // The page type (link, video, image, rich)
$embed->tags();         // The page keywords (tags)

$embed->image();         // The main image found in the page

$embed->code();          // The code to embed the image, video, etc
$embed->width();         // The width of the embed code
$embed->height();        // The height of the embed code
$embed->aspectRatio();   // The aspect ratio (width / height)

$embed->authorName();    // The resource author
$embed->authorUrl();     // The author url

$embed->providerName();  // The provider name of the page (Youtube, Twitter, Instagram, etc)
$embed->providerUrl();   // The provider url
$embed->providerIcon();  // The main icon found in the page

$embed->publishedDate(); // The published date of the resource
$embed->license();       // The license url of the resource
$embed->feeds();         // The RSS/Atom feeds
```

A global site method is available to request embed data `$site->getEmbedData($url)`).

```
$url = 'https://www.youtube.com/watch?v=XXX';
$site->getEmbedData($url);
```

4. License
----------

[](#4-license)

MIT

5. Credits
----------

[](#5-credits)

Built on top of [oscarotero/Embed](https://github.com/oscarotero/Embed).

With the help of [@tristantbg](https://github.com/tristantbg). 👨‍💻

Kirby 2 field by [@distantnative](https://github.com/distantnative/embed), from which I've copy-pasted some bits of this readme. 👀

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 Bus Factor1

Top contributor holds 67.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a4f6008eeff1d740654add452e275806c7e3959648e56ebb5394413932ed2a76?d=identicon)[mnelson-sg](/maintainers/mnelson-sg)

---

Top Contributors

[![sylvainjule](https://avatars.githubusercontent.com/u/14079751?v=4)](https://github.com/sylvainjule "sylvainjule (40 commits)")[![tristantbg](https://avatars.githubusercontent.com/u/4832038?v=4)](https://github.com/tristantbg "tristantbg (11 commits)")[![mnelson-sg](https://avatars.githubusercontent.com/u/58001706?v=4)](https://github.com/mnelson-sg "mnelson-sg (8 commits)")

### Embed Badge

![Health badge](/badges/mnelson-sg-embed/health.svg)

```
[![Health](https://phpackages.com/badges/mnelson-sg-embed/health.svg)](https://phpackages.com/packages/mnelson-sg-embed)
```

###  Alternatives

[spatie/calendar-links

Generate add to calendar links for Google, iCal and other calendar systems

1.0k7.0M8](/packages/spatie-calendar-links)[mexitek/phpcolors

A series of methods that let you manipulate colors. Just incase you ever need different shades of one color on the fly.

5003.6M18](/packages/mexitek-phpcolors)[monsieurbiz/sylius-rich-editor-plugin

A Rich Editor plugin for Sylius.

75380.8k6](/packages/monsieurbiz-sylius-rich-editor-plugin)[naucon/breadcrumbs

The breadcrumb package helps to integrate a common breadcrumb navigation into a web application. The package includes two components: A breadcrumbs class to add breadcrumb elements and a breadcrumbs helper to render html markup in php or smarty templates.

1225.4k](/packages/naucon-breadcrumbs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
