How to display limited brands in bigcommerce - bigcommerce

I am setting up a store in bigcommerce. In my theme there is a list of brands on the bottom of the page. It is displaying 10 brand names and i want to display only 4 or 5 brand names. can anyone help me how i can limit brands?

Hardeep, you'll need to use a javascript that removes the extra list items. Possibly just use jQuery slice
$(".Brands ul li").slice(5).remove();
http://api.jquery.com/slice/

Related

How to limit the number of dropdown results in v-autocomplete?

Image Link I receive 100-200 results from the axios api. I want to show only first 10 from it. Is there any way I can do that. I cannot do that from api since I also want to show the count of total items returning from axios.
Edit: I have a show all button which shows the list of all the item in new pop up. Due to this I want the exact count of total items that are returning but only want to display top 10 results from it.
One option is to use menu-props and adjust the height
<v-autocomplete :menu-props='{ nudgeTop: 110,maxHeight: 125}'></v-autocomplete>

xpath on the site is constantly changing

Peace. I registered a test on the amazon site. Doing a search of 11 iphone and then coming to a page of full products i choose first but its xpath
// span [contains (text (), 'Apple iPhone 11 (64GB) - Black')]
The problem is that I can use this xpath but tomorrow the xpath will be renamed because the first product is changed for example:
// span [contains (text (), 'Apple iPhone 11 Pro (64GB) - Space Gray')]
But I always choose the first product among all iphones even when the product changes?
Thanks.
This is the page
https://www.amazon.co.uk/s?k=iphone+11&crid=3GCCCW0Q2Z1MQ&sprefix=iph%2Caps%2C220&ref=nb_sb_noss_2
Use index and following xpath to get the first element.
(//a[#class='a-link-normal a-text-normal']/span)[1]
Always try to find something on the page that is very unlikely to change. If the element that you're looking for doesn't have such properties, look at it's ancestors.
For example, in this case, you can see that one of this span's ancestors have cel_widget_id="MAIN-SEARCH_RESULTS" which'll most likely remain constant. So, the following xpath:
//span[#cel_widget_id="MAIN-SEARCH_RESULTS"]//h2/a/span
will give you all such titles. You can get the first index as
(//span[#cel_widget_id="MAIN-SEARCH_RESULTS"]//h2/a/span)[1]
You could use the class of the search item span:
//span[#class="a-size-medium a-color-base a-text-normal"]
Then if you can do:
first_iphone = driver.find_element_by_xpath('//span[#class="a-size-medium a-color-base a-text-normal"]')
Although all search items are all the same class, (in this case a-size-medium a-color-base a-text-normal) the find_element_by_xpath method will only look for the first one.

Directus many-to-many display template not showing up

I'm not sure where Display Template option is supposed to show up on M2M relationships.
Here on movies collection setting up genres:
and the options
Docs seems confusing about the distinction between Visible Columns and Display Template:
Visible Columns sets the columns the interface shows (we're using name)
Display Template sets the columns the interface shows (we're using {{movie.name}})
Visible Columns does the above; in this example shows the title column in edit page for genres:
Alright, great!
But what about the template? maybe in the collection list?
no, just the count:
I've tried all these templates but nothing shows up anywhere:
{{title}}
{{movie.title}}
{{genre.title}}
{{genres.genre.title}}
What is the correct template here? Where is Display Template supposed to show up?
My collections setup:
movies
title text,
genres M2M (alias)
genres
title text
movies_genres
id pk,
genre numeric,
movie numeric
Thanks
This applies to O2M Interfaces:
Since there can be more than one related item linked, in the items list, the display template is rendered as a number of items until you interact with the item...
If you place your mouse over the Genres Fields, you should see the display template rendered.
A popover should show up and display the list of items as you defined.

How to center td tags in odoo QWeb

How i can center a value in table , the table contain a column that contain the same value in each raw, i need to print only one value in all the raw and not print the value for each raw.
I try to customize print rapport in odoo sale module.
Vertical alignment is a pain in the butt in html, it is not very odoo related, take a look at this answer. If you could do what you want in HTML, then style the odoo form respectfully. But beware, changing default rendering of forms is not a good idea at all!

How to specify page size in dynamically in yii view?

How to specify page size in dynamically in yii view?(not a grid view)
In my custom view page there is a search option to find list of users between 2 date
i need 2 know how to specify the page size dynamically? If number of rows less than 10 how to hide pagination ?
please check screen-shoot
I dont want the page navigation after search it confusing users..
my controller code
$criteria=new CDbCriteria();
$count=CustomerPayments::model()->count($criteria);
$pages=new CPagination($count);
// results per page
$pages->pageSize=10;
$pages->applyLimit($criteria);
$paymnt_details=CustomerPayments::model()->findAll($criteria);
$this->render('renewal',array('paymnt_details'=>$paymnt_details,'report'=>$report,'branch'=>$branch,'model'=>$model,'pages' => $pages,));
}
my view
Link
I'm assuming you want the entire list of search result be shown on a single page, no-matter how long it is?
If so, this is quite easy to achive.
As I can see in your code, you are now defining your pageSize to have a size of 10. You can update it to be dynamically be doing this:
$pages->pageSize = $count;
To remove the pagesizes you can change the css of your view file, but for that we would need your view file to see how you defined it.