Paging customization

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
I need some direction on how the product paging module could be customized.  What I would like to do is to have a Left arrow for 'Previous' and a Right arrow for 'Next' page.  We don't want to display individual page numbers, i.e. 1 2 3 etc.  Also obviously the Arrows will be little graphics.

Any help is appreciated.

Baaba
14 years ago
To omit page number links, add ShowIndividualPages="false" to the Pager control for the category template you are using.

Category templates:
Templates\Categories\ProductsInGrid.ascx
Templates\Categories\ProductsInLines1.ascx
Templates\Categories\ProductsInLines2.ascx


---

To use images instead of text for the previous, next, first, and last navigation links, set an image url for the hyperlink in the BindPrevious(), BindNext(), BindFirst(), and BindLast() methods.

Edit file: Libraries\Nop.Controls\Pager.cs
protected virtual void BindFirst(Control control)
{
    HyperLink child = new HyperLink();
    child.Text = this.FirstButtonText;    
    child.ImageUrl = "/images/page_first.gif";
    child.ToolTip = this.FirstButtonText;
    child.Style.Add(HtmlTextWriterStyle.BorderWidth, "0px");
    [...]
}
This will affect all uses of the Pager control though (manufacturer templates, forum paging, etc.). If you only need the images for product pagination links, you could add the previous, next, first, and last image names as properties to the control and use that to determine whether to use an image or text link. Either way, you will need to edit Pager.cs and recompile the solution.

These changes are for version 1.40.

.
13 years ago
for 1.6, how can I activate the paging function for the store front category products?
I see there is a pager control in the template/ProductsInGrids.ascx. How can I make it work in 1.6?
Is there paging setting for category in admin site? or should we modify the code in Nop.Controls.pager.cs ?

thanks
13 years ago
I think maybe what you want is to control the amount of products which appear in a category page ?

in admin, choose a category to edit - you will see four tabs on the page - if you select the tab 'seo'  you will see a textbox asking  'products per page'

if you set this to eg  5   and you have   6 products in that page  then the category page will display 5 products, and a pager - your 6th product will be on the next page

- hayden
13 years ago
Thank you for the response. what you say is exectlly what I need in my front site category
In my 1.6 admin site, under my Category/SEO, I can only see a  Page size text box.
I changed the number from 10 to 6 to see if it works in front store. However, I didn't see any change.I didn't see the next page and previous page either.

Is there another setting in the admin site that I forget? or something wrong in my installation?

I appriciate your help
13 years ago
I figure out why the paging (previous, next and last) function can't work  in my 1.6  front store category.

In the 1.6 DB "Nop_Product_Category_Mapping" table, I reset  the "IsFeaturedProduct" to be "false"
than the  paging function start working for every category!

Share this for reference
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.