diff --git a/theme/components/NewsCard/NewsCardComponent.php b/theme/components/NewsCard/NewsCardComponent.php index c305b0a..eabf3d9 100644 --- a/theme/components/NewsCard/NewsCardComponent.php +++ b/theme/components/NewsCard/NewsCardComponent.php @@ -24,6 +24,7 @@ protected function get_options() 'content' => [], 'image' => [], 'source' => [], + 'embedded' => [], 'link' => [ 'default' => '#' ] @@ -32,6 +33,10 @@ protected function get_options() protected function get_template_path($args, $instance) { + if (sizeof($instance['embedded']) > 0) { + return 'components/NewsCard/news_card_embedded_template.php'; + } + if (! $instance['image']) { return 'components/NewsCard/news_card_no_image_template.php'; } diff --git a/theme/components/NewsCard/news_card.scss b/theme/components/NewsCard/news_card.scss index fdd5ac9..18f085d 100644 --- a/theme/components/NewsCard/news_card.scss +++ b/theme/components/NewsCard/news_card.scss @@ -8,6 +8,7 @@ $news-card-size: 300px; overflow: hidden; flex: 1 0 $news-card-size; + flex-direction: column; background-size: cover; background-position: center; @@ -16,6 +17,11 @@ $news-card-size: 300px; color: $gray; } + .news-card__embedded > iframe { + max-width: 100% !important; + max-height: $news-card-size !important; + } + .news-card__caption { padding: 15px; diff --git a/theme/components/NewsCard/news_card_embedded_template.php b/theme/components/NewsCard/news_card_embedded_template.php new file mode 100644 index 0000000..32871f3 --- /dev/null +++ b/theme/components/NewsCard/news_card_embedded_template.php @@ -0,0 +1,13 @@ +