On Sat, 24 Oct 2009 16:44:31 -0700 (PDT)
mike <[email protected]> wrote:

> does anyone have an example on how to do pagination in /category/*
> pages without modifying satchmo source?

- install django-pagination

- add 'pagination', to installed apps

- make sure that 'django.core.context_processors.request', is listed in
TEMPLATE_CONTEXT_PROCESSORS

- add {% load pagination_tags %} near the top of your template e.g.
templates/product/category.html (having previously copied this template
from Satchmo to your project directory and edit it there).

- further down your template file, where you want the pagination to
happen, add something like this

...
    {% autopaginate products 4 %}
        {% for product in products %}
...

- make sure your pagination stuff is enclosed in the pagination CSS div.

- reload your page and enjoy paginated results.

You could write everything yourself using Django's built in pagination
as, for example, has been done with the "Featured items" in the "Large"
example project but I haven't worked that one out yet. However, as far
as I can tell there doesn't seem to be a performance hit using
django-pagination.

Regards,
Iain.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to