Skip to content

Commit

Permalink
Update view to include conditional rendering for CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio-Emmolo committed Nov 16, 2023
1 parent 77a9572 commit 3ef4bfb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion resources/views/widgetbay.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<iframe src="{{ $widgetbayLink }}" allowfullscreen="true" scrolling="no"
class="shortcode_widgetbay _iub_cs_activate" frameborder="0" height="420" loading="lazy" style="width:100%;overflow-y:hidden;"></iframe>
@else
@if($isFirstCss)
{!! $oembed->css !!}
{!! $oembed->html !!}
@endif
<div class="not-prose">
{!! $oembed->html !!}
</div>
@endif

4 changes: 2 additions & 2 deletions src/Shortcodes/WidgetbayShortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class WidgetbayShortcode
{
public function register($shortcode)
{

$widgetbayLink = '';

if ($shortcode->id) {
Expand All @@ -26,8 +25,9 @@ public function register($shortcode)
return view('shortcode-plus::widgetbay', compact('widgetbayLink'))->render();
} else {
$oembed = self::getOembed($shortcode->link ?? null, $shortcode->id ?? null);
$isFirstCss = $shortcode->firstcss ?? false;

return view('shortcode-plus::widgetbay', compact('oembed'))->render();
return view('shortcode-plus::widgetbay', compact('oembed', 'isFirstCss'))->render();
}

}
Expand Down

0 comments on commit 3ef4bfb

Please sign in to comment.