Last active
April 24, 2017 13:14
-
-
Save hypeJunction/522c1ea600b2a9e9382e45d7b16bb8d6 to your computer and use it in GitHub Desktop.
Video player in blog summary with hypeEmbed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// /views/default/object/blog.php | |
// brief view | |
preg_match_all("/\[player.*?\]/", $blog->description, $matches); | |
$embed = elgg_view('output/longtext', [ | |
'value' => $matches[0][0], | |
]); | |
$params = array( | |
'entity' => $blog, | |
'metadata' => $metadata, | |
'subtitle' => $subtitle, | |
'content' => $excerpt . $embed, | |
'icon' => $owner_icon, | |
); | |
$params = $params + $vars; | |
echo elgg_view('object/elements/summary', $params); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// /views/default/river/object/blog/create.php | |
$item = $vars['item']; | |
/* @var ElggRiverItem $item */ | |
$object = $item->getObjectEntity(); | |
$excerpt = $object->excerpt ? $object->excerpt : $object->description; | |
$excerpt = strip_tags($excerpt); | |
$excerpt = elgg_get_excerpt($excerpt); | |
// brief view | |
preg_match_all("/\[player.*?\]/", $object->description, $matches); | |
$embed = elgg_view('output/longtext', [ | |
'value' => $matches[0][0], | |
]); | |
echo elgg_view('river/elements/layout', array( | |
'item' => $vars['item'], | |
'message' => $excerpt, | |
'attachments' => $embed, | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment