Картинки подкатегорий в теме Multishop

В файде category.html нужно добавить следующий код:

        <!-- subcategories -->
        {if $category.subcategories}
        <style>
            .subcategories div {
                vertical-align: top;
                display: inline-block;
                width: 200px;
                margin: 0 20px 20px 0;
            }
            .subcategories div a.img {
                display: block;
                height: 200px;
            }
            .subcategories div a.img img {
                max-height: 190px;
                max-width: 100%;
            }
            @media only screen and (max-width: 480px) {
                .subcategories div {
                    width: 45%;
                    margin: 0 5px 15px 5px;
                }
                .subcategories div a.img {
                    height: 175px;
                }
                .subcategories div a.img img {
                    max-height: 170px;
                }
            }
        </style>
        <div class="subcategories">
            {foreach $category.subcategories as $sc}
                <div class="align-center">
                    {if $sc.image}
                        <a class="img" title="{$sc.name|escape}" href="{$sc.url}"><img src="{$wa_url}wa-data/public/shop/categories/{$sc.id}/{$sc.id}.200{$sc.image}"></a>
                    {/if}
                    <a href="{$sc.url}">{$sc.name|escape}</a>
                </div>
            {/foreach}
        </div>
        {/if}
Posted: December 13, 2016
Was this article helpful? Yes No

0 comments

    Add comment

    To add a comment please sign up or login