Find the Exponential Software extensions you want
UNIX name | Owner | Status |
---|---|---|
ocembed | 7x | stable |
Version | Compatible with |
---|---|
N/A | N/A |
oEmbed is a format for allowing an embedded representation of a URL on third party sites.
oEmbed was designed to avoid having to copy and paste HTML from the site hosting the media you wish to embed. It supports videos, images, text, and more.
This eZ extension - loosely based on the WordPress oemabed implementation - offers the oEmbed easy embedding feature via some template operator.
Enable the extension; clear all caches
You can add your own handler by creating a php class which implements oEmbedProviderInterface and adding a oEmbedProviders[] in ocembed.ini.
Print the html value of oEmbed response.
The separator and parameters variables are not required.
The separator value can be a string or an array.
The default separator value is array( '<div class="text-center">', '</div>' )
The parameters value must be an array and overrides the default ocembed.ini width and height parameters [OCEmbedSettings].EmbedDefaults.
Example:
{"http://www.slideshare.net/gggeek/ezpublish-meets-simfony2-phpday2013"|autoembed( array( '
' ), hash( 'width', '425', 'height', '355' ) )}The example returns (without html comments):
This operator is used in the eztext.tpl and ezxmltext.tpl override templates include in this extension:
{* ocembed/design/standard/templates/content/datatype/view/eztext.tpl *}
{$attribute.content.output.output_text|autoembed()}
Return all embeddable links found in passed text.
Example:
{def $test = $my_long_text_full_of_links|search_embed()}
Returns an array of embeddable urls.
Return the oEmbed response
The url parameter is required and must be an "oembeddable" url.
The parameters value must be an array and overrides the default ocembed.ini width and height parameters [OCEmbedSettings].EmbedDefaults.
Example:
{def $test = get_oembed_object("http://www.slideshare.net/gggeek/ezpublish-meets-simfony2-phpday2013")}
The $test variable contains an associative array of oembed response object.
If ocembed.ini [OCEmbedSettings] Cache is enabled, all ocembed results are stored in ezsite_data table under the key 'oembed_cached_data'.
To clear that cache, you can run php extension/ocembed/bin/php/clear_cache_data.php -s<siteaccess>