Support for image block in own article
This commit is contained in:
@@ -30,39 +30,24 @@
|
|||||||
<div class="author">{{$block->data->caption}}</div>
|
<div class="author">{{$block->data->caption}}</div>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
@elseif($block->type == "image")
|
@elseif($block->type == "image")
|
||||||
<?php
|
<a class="post_image page_margin_top prettyPhoto" rel="prettyPhoto" href="/{{$block->data->url}}"
|
||||||
if(isset($block->data->image->imageWide))
|
title="{{$block->data->title}} © {{$block->data->title}}">
|
||||||
$image = $block->data->image->imageWide;
|
<img src="/{{$block->data->url}}" class="attachment-small-slider-thumb size-small-slider-thumb wp-post-image"
|
||||||
else if(isset($block->data->image->crop))
|
alt="{{$block->data->title}}" title="" style="display: block;">
|
||||||
$image = $block->data->image->crop;
|
|
||||||
else if(isset($block->data->image->crops) && isset($block->data->image->crops->{'16:9'}))
|
|
||||||
foreach($block->data->image->crops->{'16:9'} as $image) break;
|
|
||||||
else if(isset($block->data->image->imageHigh))
|
|
||||||
$image = $block->data->image->imageHigh;
|
|
||||||
else $image = null;
|
|
||||||
?>
|
|
||||||
@if($image)
|
|
||||||
<a class="post_image page_margin_top prettyPhoto" rel="prettyPhoto" href="{{$image}}"
|
|
||||||
title="{{$block->data->image->title}} © {{$block->data->image->author}}">
|
|
||||||
<img src="{{$image}}" class="attachment-small-slider-thumb size-small-slider-thumb wp-post-image"
|
|
||||||
alt="{{$block->data->image->title}}" title="" style="display: block;">
|
|
||||||
</a>
|
</a>
|
||||||
<div class="sentence">
|
<div class="sentence">
|
||||||
<?php
|
<?php
|
||||||
$sentence = [];
|
$sentence = [];
|
||||||
if (isset($block->data->image->caption) && $block->data->image->caption) {
|
if (isset($block->data->title) && $block->data->title) {
|
||||||
$sentence[] = '<span class="text">' . $block->data->image->caption . '</span>';
|
$sentence[] = '<span class="text">' . $block->data->title . '</span>';
|
||||||
} elseif (isset($block->data->image->title) && $block->data->image->title) {
|
|
||||||
$sentence[] = '<span class="text">' . $block->data->image->title . '</span>';
|
|
||||||
}
|
}
|
||||||
if (isset($block->data->image->author) && $block->data->image->author) {
|
if (isset($block->data->author) && $block->data->author) {
|
||||||
$sentence[] = '<span class="author">' . $block->data->image->author . '</span>';
|
$sentence[] = '<span class="author">' . $block->data->author . '</span>';
|
||||||
}
|
}
|
||||||
$sentence = join('<span class="separator">|</span>', $sentence);
|
$sentence = join('<span class="separator">|</span>', $sentence);
|
||||||
?>
|
?>
|
||||||
{!!$sentence!!}
|
{!!$sentence!!}
|
||||||
</div>
|
</div>
|
||||||
@endif
|
|
||||||
@elseif($block->type == "video" || $block->type == "headerVideo")
|
@elseif($block->type == "video" || $block->type == "headerVideo")
|
||||||
@include('widgets/mediaplayer')
|
@include('widgets/mediaplayer')
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
Reference in New Issue
Block a user