Отображение конкретных записей блога в магазине

Приветствую!

Есть блок blog-latest-posts, который выводит последние записи блога каруселькой:


Блок выглядит так:

{$latest_posts = $wa->blog->posts()}
<div>
{foreach $latest_posts as $post}
    {if $post@first}
        <!-- Use $post.text_before_cut to display post text -->
        <!-- Use $post.image_scr to get src attr from first image in post text -->
        <div class="big_post">
            <!--noindex--><a href="{$post.link}"><img src="{$post.image_scr}"></a><!--/noindex-->
          <h3>
            <a href="{$post.link}">{$post.title}</a>
            {* @event prepare_posts_frontend.%plugin_id%.post_title *}
            {if !empty($post.plugins.post_title)}
              {foreach $post.plugins.post_title as $plugin => $output}{$output}{/foreach}
            {/if}
          </h3>
          <div class="credentials">
            {$post.datetime|date_format:"%B %Y"}
          </div>
          <div class="post_text">{$post.text_before_cut}</div>
          <p style="margin-bottom: 15px;float:right;" >
            <!--noindex--><a href="{$post.link}" class="readmore">Читать далее »</a><!--/noindex-->
          </p>
        </div>    
    {/if}
{/foreach}
<img src="/wa-data/public/site/themes/default/img/left_sh.png" class="left_shadow">
<img src="/wa-data/public/site/themes/default/img/right_sh.png" class="right_shadow">
<ul class="blog_car carousel">
    
{foreach $latest_posts as $post}
    {if !$post@first}
        <!-- Use $post.text_before_cut to display post text -->
        <!-- Use $post.image_scr to get src attr from first image in post text -->
        <li class="post">
            <!--noindex--><a href="{$post.link}"><img src="{$post.image_scr}"></a><!--/noindex-->
            <h3>
                <a href="{$post.link}">{$post.title} </a>
                {* @event prepare_posts_frontend.%plugin_id%.post_title *}
                {if !empty($post.plugins.post_title)}
                    {foreach $post.plugins.post_title as $plugin => $output}{$output}{/foreach}
                {/if}
            </h3>
        </li>
    {/if}
{/foreach}
    
</ul>
</div>

И выводится со скриптом:

<div class="blog to_blog">
		<h2 style="    height: 16px;    border-bottom: 1px solid rgb(150, 150, 150);    margin: 14px 0px 37px;">
			<span><noindex>Наш блог</noindex></span>
			<noindex><a href="/blog/" class="all_blogs">Все статьи</a></noindex>
		</h2>
		{$wa->block("blog.latest_posts")}
		{literal}
		<script type="text/javascript">
			jQuery(document).ready(function() {
				jQuery('.blog_car').jcarousel({
					scroll:1,
					animation:"fast",
					wrap:"circular"
				});
			});
		</script>
		{/literal}
	</div>

У меня собственно 2 вопроса:

1. Как вывести миниатюру конкретной записи блога в магазине по её id? Ну чтобы, например, на странице финикового сиропа вывести красивую миниатюру обзора на этот самый сироп.

2. Как вывести последние не из всех записей, а последние записи конкретного блога? Например, чтобы последние записи блога "Полезное питание" вывести в категории товаров полезного питания, а последние записи блога "Стройность и красота" вывести в категории товаров "Худеем правильно" и т.п.

ещё сейчас родился немного бредовый третий вопрос. Возможно ли как-то за счёт, например, тэгов выводить "карусельку" из конкретных записей блога в категориях магазина? Например, в категории "Уход за лицом" есть товары с тэгами "Уход за лицом", и в "карусельке" внизу выводились бы записи блога, которые тоже содержат такой тэг. Это ведь реализовано в рамках самого блога (рекомендованные записи к статье http://joxi.ru/LmG0NwzCx6l72l?d=1

4 ответа

Добавить ответ

Чтобы добавить комментарий, зарегистрируйтесь или войдите