Hi,
I'd like to know if anyone can help me add more search options to view on the frontend of the JS Video Module.
I'd like to display videos from a jomsocial video "Category".
Here's a code that provides a slider for jomsocial events, but it doesn't offer from a CATEGORY.
<?php
$config = CFactory::getConfig();
$document = JFactory::getDocument();
$document->addScriptDeclaration("joms_prev_comment_load = +'" . $config->get('prev_comment_load', 10) . "';");
?>
<script src="https://cdn.jsdelivr.net/npm/@splidejs/splide@4.1.4/dist/js/splide.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/@splidejs/splide@4.1.4/dist/css/splide.min.css" rel="stylesheet">
<div class="splide">
<div class="joms-module joms-js--video-module splide__track">
<?php if (!empty($videos)) { ?>
<ul class="splide__list">
<?php foreach ($videos as $video) { ?>
<li class="splide__slide">
<a <?php if ($isVideoModal) { ?> href="javascript:" onclick="joms.api.videoOpen('<?php echo $video->id; ?>');" <?php } else { ?> href="<?php echo $video->getURL(); ?>" <?php } ?>>
<img src="<?php echo $video->getThumbNail(); ?>" alt="<?php echo $video->getTitle(); ?>" title="<?php echo CStringHelper::escape($video->title); ?>" />
</a>
</li>
<?php } ?>
</ul>
<?php } else { ?>
<div class="joms-blankslate"><?php echo JText::_('COM_COMMUNITY_VIDEOS_NO_VIDEO'); ?></div>
<?php } ?>
</div>
</div>
<div class="joms-gap"></div>
<a href="<?php echo CRoute::_('index.php?option=com_community&view=videos'); ?>" class="joms-button--link">
<small><?php echo JText::_('COM_COMMUNITY_VIDEOS_ALL'); ?></small>
</a>
<script>
(function(w) {
var splide = new Splide('.splide', {
perPage: 2,
focus: 0,
pagination: false,
omitEnd: true,
});
splide.mount();
w.joms_queue || (w.joms_queue = []);
w.joms_queue.push(function($) {
var $ct = $('#latest-videos-nav'),
$loading = $ct.find('.joms-js--loading');
function render(json) {
$list = $('.joms-js--video-module').find('.joms-list--half');
$list.html(json.html || ' ');
}
$ct.on('click', '.newest-videos', function(e) {
$loading.show();
joms.ajax({
func: 'frontpage,ajaxGetNewestVideos',
data: [frontpageVideos],
callback: function(json) {
$(e.target).addClass('active-state').siblings('a').removeClass('active-state');
$loading.hide();
render(json);
}
});
});
$ct.on('click', '.featured-videos', function(e) {
$loading.show();
joms.ajax({
func: 'frontpage,ajaxGetFeaturedVideos',
data: [frontpageVideos],
callback: function(json) {
$(e.target).addClass('active-state').siblings('a').removeClass('active-state');
$loading.hide();
render(json);
}
});
});
$ct.on('click', '.popular-videos', function(e) {
$loading.show();
joms.ajax({
func: 'frontpage,ajaxGetPopularVideos',
data: [frontpageVideos],
callback: function(json) {
$(e.target).addClass('active-state').siblings('a').removeClass('active-state');
$loading.hide();
render(json);
}
});
});
});
})(window);
</script>