Адаптивность шаблона

11.05.2021 08:46
#1
dgoncharov
Joomshopping forum user no avatar
Name: Dmitry
11.10.2020
Posts: 60
Quote
Адаптивность шаблона

Привет. В шаблоне сделан вывод по 3 товара в ряд sblock3. Но на мобильном надо сделать вывод по 2 товара в ряд. По дефолту они перестраиваются в 1 колонку. Но если сделать ширину

@media (max-width: 767px)
.row-fluid .sblock3 {
width: 50%;
}

То у второй строчки остается хвост в виде одного товара. Как тут можно правильно организовать адаптивность товаров? Спасибо

 
12.05.2021 17:04
#2
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25857
Quote
Aw: Адаптивность шаблона

Проблема в row-fluid в каждом ряду
Нужно менять шаблон переносить <div class = "row-fluid"> за цыкл

пример

<div class="jshop list_product" id="comjshop_list_product">
<?php print $this->_tmp_list_products_html_start?>
<?php foreach ($this->rows as $k=>$product) : ?>
<?php if ($k % $this->count_product_to_row == 0) : ?>
<div class = "row-fluid">
<?php endif; ?>

<div class = "sblock<?php echo $this->count_product_to_row;?>">
<div class = "block_product">
<?php include(dirname(__FILE__)."/".$product->template_block_product);?>
</div>
</div>

<?php if ($k % $this->count_product_to_row == $this->count_product_to_row - 1) : ?>
<div class = "clearfix"></div>
</div>
<?php endif; ?>
<?php endforeach; ?>

<?php if ($k % $this->count_product_to_row != $this->count_product_to_row - 1) : ?>
<div class = "clearfix"></div>
</div>
<?php endif; ?>
<?php print $this->_tmp_list_products_html_end;?>
</div>

поменять на

<div class="jshop list_product" id="comjshop_list_product">
<?php print $this->_tmp_list_products_html_start?>
<div class = "row-fluid">
<?php foreach ($this->rows as $k=>$product) : ?>
<div class = "sblock<?php echo $this->count_product_to_row;?>">
<div class = "block_product">
<?php include(dirname(__FILE__)."/".$product->template_block_product);?>
</div>
</div>
<?php endforeach; ?>
</div>
<?php print $this->_tmp_list_products_html_end;?>
</div>


Letzte Änderung: 12.05.2021 17:05
 
30.10.2022 11:27
#3
antonreut
Joomshopping forum user no avatar
Name: Anton
07.07.2014
Posts: 1
Quote
Aw: Адаптивность шаблона

А можно как в админке добавить опцию "товаров в ряду при мобильной верстке"?

admin - 12.05.2021 17:04
Проблема в row-fluid в каждом ряду
Нужно менять шаблон переносить <div class = "row-fluid"> за цыкл

пример

<div class="jshop list_product" id="comjshop_list_product">
<?php print $this->_tmp_list_products_html_start?>
<?php foreach ($this->rows as $k=>$product) : ?>
<?php if ($k % $this->count_product_to_row == 0) : ?>
<div class = "row-fluid">
<?php endif; ?>

<div class = "sblock<?php echo $this->count_product_to_row;?>">
<div class = "block_product">
<?php include(dirname(__FILE__)."/".$product->template_block_product);?>
</div>
</div>

<?php if ($k % $this->count_product_to_row == $this->count_product_to_row - 1) : ?>
<div class = "clearfix"></div>
</div>
<?php endif; ?>
<?php endforeach; ?>

<?php if ($k % $this->count_product_to_row != $this->count_product_to_row - 1) : ?>
<div class = "clearfix"></div>
</div>
<?php endif; ?>
<?php print $this->_tmp_list_products_html_end;?>
</div>

поменять на

<div class="jshop list_product" id="comjshop_list_product">
<?php print $this->_tmp_list_products_html_start?>
<div class = "row-fluid">
<?php foreach ($this->rows as $k=>$product) : ?>
<div class = "sblock<?php echo $this->count_product_to_row;?>">
<div class = "block_product">
<?php include(dirname(__FILE__)."/".$product->template_block_product);?>
</div>
</div>
<?php endforeach; ?>
</div>
<?php print $this->_tmp_list_products_html_end;?>
</div>


 
30.10.2022 15:40
#4
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25857
Quote
Aw: Адаптивность шаблона

Нет такой возможности.
Меняйте CSS под себя

 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.