Community Documentation

ARCHIVE: AJAX Views: Block paging of a View via AJAX

Last updated March 25, 2011. Created by pragna on January 17, 2008.
Edited by linclark, JohnNoc, febbraro. Log in to edit this page.

This module, AJAX Views, provides a mechanism for a View block to have AJAX based pagination.

Getting Started:

  1. Create or edit a View
  2. Specify a Page view of any type
  3. Specify a Block view with "AJAX Paging Block View" type and the node count you want on each page
  4. Specify an argument of type "AJAX Views: AJAX Selector" with "Display all values" specified
  5. If you have other arguments, make sure there are valid wildcards for them
  6. Finally, either embed your view in a page via views_build_view('block', $view) or put your block in a region

Theme support:
This module has outstanding theming support. You can customize nearly any part of the rendering for all blocks/pages or specific renderings. The following are theme hooks implemented in AJAX views.

  • theme_views_ajax - Traffic cop theme function to render both the block wrapper and the ajax content that is held within the wrapper. This is a global override theme function, most likely you will leave this alone.
  • theme_views_ajax_block - Theme function to render the body of the ajax-ified block (including what Javascript and CSS is executed/included)
  • theme_views_ajax_block_[viewname] - Same as theme_views_ajax_block but for a view with a specific name
  • theme_views_ajax_page - Theme function to render the dynamic ajax page that is served to the block
  • theme_views_ajax_page_[viewname] - Same as theme_views_ajax_page but for a view with a specific name
  • theme_views_ajax_page_item - Theme function to render the dynamic ajax page individual items.
  • theme_views_ajax_page_item_[viewname] - Same as theme_views_ajax_page_item but for a view with a specific name
  • theme_views_ajax_block_pager - Theme function to render the paging links at the bottom of the ajax page

TO-DO:

  • Better support for view arguments
  • Better documentation

This project is sponsored by Phase2 Technology

About this page

Drupal version
Drupal 5.x

Archive

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.