Upload
dfeyer
View
799
Download
1
Embed Size (px)
Citation preview
/** * Embedly Helper */ class EmbedlyHelper implements ProtectedContextAwareInterface { /** * @param string $url * @return array */ public function oembed($url) { $embedly = new Embedly(); $response = $embedly->oembed([ 'url' => $url ]); $data = json_decode(json_encode(reset($response)), true); return $data; }
/** * All methods are considered safe * * @param string $methodName * @return boolean */ public function allowsCallOfMethod($methodName) { return true;
prototype(Ttree.Embedly:Oembed) { @override.response = ${Embedly.oembed(q(node).property('url'))}
content = TYPO3.TypoScript:Case { link { condition = ${response.type == 'link'} type = 'Ttree.Embedly:Oembed.Link' } video { condition = ${response.type == 'video'} type = 'Ttree.Embedly:Oembed.Video' } photo { condition = ${response.type == 'photo'} type = 'Ttree.Embedly:Oembed.Photo' } } }
[email protected] - @ttreeagency - github.com/ttreeagency
tt ttreedigital beans
you are welcome in our office @ lausanne don’t be shy ping us is you are in the area