Hi,

I am currently building a small business site using Drupal 7. The site basically has:

  1. Products page: List all product categories. For example: Category A, B, C.
  2. Product Category page: List product table from each category. For example: Category A page: Product A1, A2, A3.
  3. Product Detail page: List each individual product in detail.

The way I did this was by creating Taxonomy Vocabulary "Products" and list terms: "Category A", "Category B", & "Category C".
Then I created new content type for "Product Detail" page which include Term Reference field for "Products" vocabulary, so that I can categorize the products accordingly when I am creating each product page.
Then, using Views, I created view pages for all Category pages, configured them, sorted them by posting date(ascend) and filtered them according to each taxonomy term. Finished! All looks great!

Now I would like to add Previous/Next buttons to each Product Detail Page. How do I accomplish this? Do I need to create theme function inside template.php?

Please help me...Thanks.

hc.

Comments

nevets’s picture

You could try the Custom Pagers module.

peterjlord’s picture

You should really use flippy as custom pages is drupal6

robhoefakker’s picture

The easiest way without using hooks en changing template files is to configure your views pager settings to Full pager:
Items to display: 1
Number of pager links visible: 0

You can hide the first and last links using css..:

.pager-last,
.pager-first{
display:none;
}
chanjay’s picture

Thanks for the replies friends!

@robhoefakker
I still want to show a list of product table on the view page. For example: Category A (view) page displays table of products related to Category A. Then when clicking on each product image/link, it will take to product detail page and this is where I want to have the Previous/Next button, so the visitor doesn't have to go back to Category page to see the next product.

I know there is a module for this which I have not tried yet, but is it easy to write a code for this? at the same time I would like to study writing Drupal code.

Thanks in advance!

hc.

vm’s picture

I know there is a module for this which I have not tried yet, but is it easy to write a code for this?

Ease is dependent on variables not included in this forum post. My suggestion would be to look at the code for the module you've not tried yet. It should provide you with better idea than can be typed out in a forum comment.

chanjay’s picture

Gotcha! Thanks.

hc.

giorgosk’s picture

------
GiorgosK
Web Development