How to specify category for random content slider

Hi,
Can you let me know how to specify the category, which the content slider with run the random product
For example in the Beauty & Health block, we want the content slider to display random product from the Beauty & Health category. Currently the content slider would display random products from any category.

4 answers

Profile photo of Ziven Staff 100280.00 $tone August 19, 2019
Public

Hi there,

For example in the Beauty & Health block, we want the content slider to display random product from the Beauty & Health category. Currently the content slider would display random products from any category.

Please refer to our userguide here, you should see the “UB Content Slider Params” which allows to define the param “category_ids”. 
 
Hope that helps. 

Best Regards,
Ziven.
 

#1
Profile photo of Danny Nguyen 210.00 $tone August 19, 2019
Public

How do I remove the <div class=“ub-style2 ub-style2-right”> and extent the <div class=“ub-style1”> so it fill the empty space of the “ub-style2”

#2
Profile photo of Ziven Staff 100280.00 $tone August 19, 2019
Public

Hi there,


How do I remove the <div class=“ub-style2 ub-style2-right”> and extent the <div class=“ub-style1”> so it fill the empty space of the “ub-style2”

When you change these classes, it will affect the HTML markup that has been pre-defined in our theme. 
Could you provide further specific information how you want to make custom change. We will check and help you out, if it’s minor tweak. For heavy customization, I am afraid it should be handled at your end.
 

Also I don’t see the “name” param in the user guide can you explain what it is and how to use it. Like: name=”ub.bh.right.slider”

Please let us know whether you’re using MegaMall theme for Magento 1 or UB Megamall for Magento 2?
 
You can find below the code block in our UB MegaMall theme for Magento 2. Navigate to your Magento 2 admin > Content > Elements > Blocks, open the UB Block Beauty & Health (beauty-health) block, you should see: 
 

<div class=”ub-banner”><a href=”{{config path=&quot;web/unsecure/base_url&quot;}}”> <img src=”{{media url=&quot;wysiwyg/ubmegamenu/banner9.jpg&quot;}}” alt=”” width=”1080px” height=”90px”> </a></div>
<div class=”block block-cate”><a class=”title” href=”{{config path=&quot;web/unsecure/base_url&quot;}}”>Beauty &amp; Health</a>
<ul>
<li><a href=”{{store url=’fashion.html’}}”>Luxury Beauty</a></li>
<li><a href=”{{store url=’fashion.html’}}”>New Arrivals</a></li>
<li><a href=”{{store url=’fashion.html’}}”>Makeup</a></li>
<li><a href=”{{store url=’fashion.html’}}”>Skin Care</a></li>
<li><a href=”{{store url=’fashion.html’}}”>Hair Care</a></li>
<li><a href=”{{store url=’fashion.html’}}”>Fragrance</a></li>
</ul>
</div>
<div class=”ub-block-products”>
<div class=”ub-style1″>
<div class=”category-title”>
<h3>Best selling Updated hourly</h3>
<a href=”{{store url=’fashion.html’}}”>view all</a></div>
{{block class=”Ubertheme\UbContentSlider\Block\Slider” name=”ub.bh.left.slider” title=”Best Selling” show_title=”0″ content_type=”random_products” show_desc=”0″ show_wishlist=”0″ show_compare=”0″ show_add_cart=”0″ show_navigation=”0″ show_paging=”0″ auto_run=”0″ number_items=”4″ number_items_desktop=”4″ }}</div>
<div class=”ub-style2 ub-style2-right”>
<div class=”category-title”>
<h3>on sale 30-70%</h3>
</div>
{{block class=”Ubertheme\UbContentSlider\Block\Slider” name=”ub.bh.right.slider” template=”slider_products_right_home.phtml” title=”on sale” show_title=”0″ content_type=”random_products” show_desc=”0″ show_wishlist=”0″ show_compare=”0″ show_add_cart=”0″ show_paging=”0″ show_review=”0″ number_items=”1″ number_items_desktop=”1″ number_items_desktop_small=”1″ number_items_tablet=”1″ number_items_tablet_small=”1″ slide_transition=”backSlide” auto_run=”0″ }}</div>
</div>

You can change it to (see the code section highlighted in red):  

<div class=”ub-banner”><a href=”{{config path=&quot;web/unsecure/base_url&quot;}}”> <img src=”{{media url=&quot;wysiwyg/ubmegamenu/banner9.jpg&quot;}}” alt=”” width=”1080px” height=”90px”> </a></div>
<div class=”block block-cate”><a class=”title” href=”{{config path=&quot;web/unsecure/base_url&quot;}}”>Beauty &amp; Health</a>
<ul>
<li><a href=”{{store url=’fashion.html’}}”>Luxury Beauty</a></li>
<li><a href=”{{store url=’fashion.html’}}”>New Arrivals</a></li>
<li><a href=”{{store url=’fashion.html’}}”>Makeup</a></li>
<li><a href=”{{store url=’fashion.html’}}”>Skin Care</a></li>
<li><a href=”{{store url=’fashion.html’}}”>Hair Care</a></li>
<li><a href=”{{store url=’fashion.html’}}”>Fragrance</a></li>
</ul>
</div>
<div class=”ub-block-products”>
<div class=”ub-style1″>
<div class=”category-title”>
<h3>Best selling Updated hourly</h3>
<a href=”{{store url=’fashion.html’}}”>view all</a></div>
{{block class=”Ubertheme\UbContentSlider\Block\Slider” name=”ub.bh.left.slider” title=”Best Selling” show_title=”0″ category_ids=”INPUT_YOUR_CATEGORY_ID” content_type=”random_products” show_desc=”0″ show_wishlist=”0″ show_compare=”0″ show_add_cart=”0″ show_navigation=”0″ show_paging=”0″ auto_run=”0″ number_items=”4″ number_items_desktop=”4″ }}</div>
<div class=”ub-style2 ub-style2-right”>
<div class=”category-title”>
<h3>on sale 30-70%</h3>
</div>
{{block class=”Ubertheme\UbContentSlider\Block\Slider” name=”ub.bh.right.slider” template=”slider_products_right_home.phtml” title=”on sale” show_title=”0″ content_type=”random_products” category_ids=”INPUT_YOUR_CATEGORY_ID” show_desc=”0″ show_wishlist=”0″ show_compare=”0″ show_add_cart=”0″ show_paging=”0″ show_review=”0″ number_items=”1″ number_items_desktop=”1″ number_items_desktop_small=”1″ number_items_tablet=”1″ number_items_tablet_small=”1″ slide_transition=”backSlide” auto_run=”0″ }}</div>
</div>

For the param category_ids=”INPUT_YOUR_CATEGORY_ID”, you can change to to the category IDs you want to show. For example: category_ids=”10, 15″.
 
Hope that helps. 
 
Best Regards,
Ziven.

#4

Please login or Register to Submit Answer

Written By

Comments