Answer the question
In order to leave comments, you need to log in
How to display news preview on the page?
there is this code
@if (count($posts)>0)
@foreach ($posts as $post)
<article class="shnews clearfix">
<div class="short-in">
<div class="sh-desc">
<a href="{{route('front.news', $post->slug)}}"><div class="sh-title">{{$post->title}}</div></a>
<div class="sh-orgtitle">
<span style="width: 110px">
<i class="fa fa-clock-o"></i> {{ App::make("HelperController")->formateCreationDate($post->created_at) }} ·
</span>
<span><i class="fa fa-user"></i> {{$post->user->username}}</span>
@if(!is_null($post->manga))
<span> · <i class="fa fa-folder-open-o"></i> {{ link_to_route('front.manga.show', $post->manga->name, $post->manga->slug) }}</span>
@endif
</div>
</div>
</div>
</article>
@endforeach
<div class="floats clearfix">
@foreach ($mangaNews as $post)
<?php
preg_match('#<img[^>]*src="([^"]+)"#Uiu', $post->content, $match);
if (count($match)) $img = $match[1];
else $img = '';
?>
<article class="short shnews clearfix" id="short">
<div class="short-in">
<div class="sh-desc">
<a href="{{route('front.news', $post->slug)}}"><div class="sh-title">{{$post->title}}</div></a>
</div>
<a class="short-poster img-box" href="{{route('front.news', $post->slug)}}">
@if ($img) <img src="{{ $img }}"/> @endif
<div class="short-meta short-label sl-y">
<span style="width: 110px">
<i class="fa fa-clock"></i> {{ App::make("HelperController")->formateCreationDate($post->created_at) }}
</span><br/>
<span><i class="fa fa-user"></i> {{$post->user->username}}</span><br/>
@if(!is_null($post->manga))
<span> <i class="fa fa-folder-open-o"></i> {{ link_to_route('front.manga.show', $post->manga->name, $post->manga->slug) }}</span>
@endif
</div>
</a>
</div>
</article>
@endforeach
</div>
@endif
<a class="short-poster img-box" href="{{route('front.news', $post->slug)}}">
@if ($img) <img src="{{ $img }}"/> @endif
@if ($img) <img src="{{ $img }}"/> @endif
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question