Jump to content

вертикальные миниатюры


Afanasoff
 Share

Recommended Posts

В 30.09.2024 в 13:33, Afanasoff сказал:

Подскажите решение или модуль вывода доп. миниатюр товаров вертикальной каруселью.

не будет для такого модулей. вопрос чисто верстки, зачастую с прикручиванием swiper или slick. Может быть встроено в какой-то шаблон.

например практически готовый кусок

https://gist.github.com/LuisGMoralesRaya/f09ac47228902459046c480eb1a5d049

демонстрация работы

https://codepen.io/rogerkuik/pen/abZOLXr

только в html вставить цикл по превьюхам и поправить ксс

Link to comment
Share on other sites

В тройке можно немного попроще. 
catalog/view/theme/default/template/product/product.twig
Найти весь блок картинок
 

{% if thumb or images %}
          <ul class="thumbnails">
            {% if thumb %}
            <li><a class="thumbnail" href="{{ popup }}" title="{{ heading_title }}"><img src="{{ thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" /></a></li>
            {% endif %}
            {% if images %}
            {% for image in images %}
            <li class="image-additional"><a class="thumbnail" href="{{ image.popup }}" title="{{ heading_title }}"> <img src="{{ image.thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" /></a></li>
            {% endfor %}
            {% endif %}
          </ul>
{% endif %}

И заменить со списка ul-li  частично на блоки col.

 Что то типа 
 

<div class="row  thumbnails">
   {% if images %}
   <div class="col-sm-2">
      <ul class="thumbnails-list">
         {% for image in images %}
         <li>
            <a class="thumbnail" href="{{ image.popup }}" title="{{ heading_title }}">
               <img src="{{ image.thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" />
            </a>
         </li>
         {% endfor %}
      </ul>
   </div>
   {% endif %}
   <div class="{{ images ? 'col-sm-10' : 'col-sm-12' }}">
      {% if thumb %}
      <a class="thumbnail main-image-container" href="{{ popup }}" title="{{ heading_title }}">
         <img src="{{ thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" id="main-image" />
      </a>
      {% endif %}
   </div>  
</div>  


Ну и перед {{ footer }} , так например
 

         <style>
          .thumbnails-list {list-style: none;padding: 0;margin: 0;overflow-y: auto;}
          .thumbnails li {margin-bottom: 10px;}
        </style>
        <script type="text/javascript">
          $(document).ready(function() {
            var mainImageHeight = $('.main-image-container').height();
            $('.thumbnails-list').height(mainImageHeight);
          });
        </script>

 

Link to comment
Share on other sites

В 30.09.2024 в 21:36, Tom сказал:

В тройке можно немного попроще. 
catalog/view/theme/default/template/product/product.twig
Найти весь блок картинок
 

{% if thumb or images %}
          <ul class="thumbnails">
            {% if thumb %}
            <li><a class="thumbnail" href="{{ popup }}" title="{{ heading_title }}"><img src="{{ thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" /></a></li>
            {% endif %}
            {% if images %}
            {% for image in images %}
            <li class="image-additional"><a class="thumbnail" href="{{ image.popup }}" title="{{ heading_title }}"> <img src="{{ image.thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" /></a></li>
            {% endfor %}
            {% endif %}
          </ul>
{% endif %}

И заменить со списка ul-li  частично на блоки col.

 Что то типа 
 

          <div class="row  thumbnails">
            {% if images %}
              <div class="col-sm-2">
                <ul class="thumbnails-list">
                  {% for image in images %}
                    <li>
                      <a class="thumbnail" href="{{ image.popup }}" title="{{ heading_title }}">
                        <img src="{{ image.thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" />
                      </a>
                    </li>
                  {% endfor %}
                </ul>
              </div>
            {% endif %}
            <div class="{{ images ? 'col-sm-10' : 'col-sm-12' }}">
              {% if thumb %}
                <a class="thumbnail main-image-container" href="{{ popup }}" title="{{ heading_title }}">
                  <img src="{{ thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" id="main-image" />
                </a>
              {% endif %}
            </div>


Ну и перед {{ footer }} , так например
 

         <style>
          .thumbnails-list {list-style: none;padding: 0;margin: 0;overflow-y: auto;}
          .thumbnails li {margin-bottom: 10px;}
        </style>
        <script type="text/javascript">
          $(document).ready(function() {
            var mainImageHeight = $('.main-image-container').height();
            $('.thumbnails-list').height(mainImageHeight);
          });
        </script>

 

Мне для 2.1 нужно. Нашел пару бесплатных модификаторов - но там без карусели.

Link to comment
Share on other sites

<div class="left product-image thumbnails">
            <?php if ($thumb || $images) { ?>
              <div class="col-sm-2" style="padding-right: 0px;">
                <ul class="thumbnails-list">
                  <?php if ($images) { ?>
					<?php foreach ($images as $image) { ?>
                    <li>
                      <a class="elevatezoom-gallery thumbnail" href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>">
                        <img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" />
                      </a>
                    </li>
					<?php } ?>
				  <?php } ?>
                </ul>
              </div>
            <?php } ?>
            <div class="col-sm-10">
              <?php if ($thumb) { ?>
                <a class="elevatezoom-gallery thumbnail main-image-container" href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>">
                  <img src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" id="main-image" />
                </a>
              <?php } ?>
            </div>
		    </div>
<style>
          .thumbnails-list {list-style: none;padding: 0;margin: 0;overflow-y: auto;}
          .thumbnails li {margin-bottom: 10px;}
        </style>
        <script type="text/javascript">
          $(document).ready(function() {
            var mainImageHeight = $('.main-image-container').height();
            $('.thumbnails-list').height(mainImageHeight);
          });
        </script>

Для 2.1 Может кому пригодится.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...