@php $args = [ '@limit' => $data->post_number ? $data->post_number : 20, '@sort' => $data->sorttype ? $data->sorttype : 1, ]; $title = null; if ($data->dynamic_id && ($dynamic = $helper->getDynamic(['id' => $data->dynamic_id]))) { $args['dynamic_id'] = $data->dynamic_id; $title = $dynamic->name; } if ($data->category_id && ($category = $helper->getPostCategory(['id' => $data->category_id]))) { $args['@category'] = $data->category_id; if (!$title) { $title = $category->name; } } if ($data->content_type && $data->content_type != 'all') { $args['content_type'] = $data->content_type; } if ($data->title) { $title = $data->title; } $args['trashed_status'] = 0; $style = ''; if($data->background_type == 'color' || $data->background_type == 'both'){ $style .= "background-color: $data->background_color; "; } if(($data->background_type == 'image' || $data->background_type == 'both') && $image = $data->background_image){ $style .= "background-image: url('$data->background_image'); background-repeat: no-repeat; background-size: cover;"; } @endphp

{{$title}}

@if (count($posts = $helper->getPosts($args))) @include($_template.'posts.list', ['posts' => $posts]) @endif