Index: README.txt =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/insert_view/README.txt,v retrieving revision 1.2.4.1 diff -u -p -r1.2.4.1 README.txt --- README.txt 11 Jan 2008 17:20:09 -0000 1.2.4.1 +++ README.txt 4 Mar 2008 06:26:43 -0000 @@ -21,6 +21,10 @@ term ID as an argument: In short this tag says, "Insert the view named book_reviews, limit the number of results to 5, and supply the argument/term ID 2." +Also, if you'd like to use a pager with your view, use the following syntax +(note: you must set a limit which will serve as the nodes per page): +[view_pager:=]. + INSTALLATION ------------ Drop it into your modules folder and turn it on. Obviously, it requires the Views module to @@ -36,7 +40,7 @@ Insert_view is not a strict filter modul instructions via the filter system, but actually accomplishes its inserting of views through hook_nodeapi() so that it has the proper context within which to run. Because there is no hook_nodeapi() equivalent for blocks (that this developer is aware of), we can't similarly -parse blocks. If you've enabled the filter tips (as detailed in the previous paragraph), you +parse blocks. If you've enabled the filter tips (as detailed in the previous paragraph), the insert_view filter tips will appear on your block edit page but they won't work. This is an unfortunate result of using filter tips to display this info, as normally filter tips would work for blocks. In this case, however, they don't, and I'm yet to identify an elegant Index: insert_view.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/insert_view/insert_view.module,v retrieving revision 1.6.2.4 diff -u -p -r1.6.2.4 insert_view.module --- insert_view.module 30 Jun 2007 04:03:28 -0000 1.6.2.4 +++ insert_view.module 4 Mar 2008 06:26:43 -0000 @@ -53,11 +53,12 @@ function insert_view_nodeapi(&$node, $op } function _insert_view_substitute_tags(&$node, $field) { - if (preg_match_all("/\[view:([^=\]]+)=?([^=\]]+)?=?([^\]]*)?\]/i", $node->$field, $match)) { - foreach ($match[2] as $key => $value) { - $viewname = $match[1][$key]; - $limit = $match[2][$key]; - $view_args = $match[3][$key]; + if (preg_match_all("/\[view(_pager)?:([^=\]]+)=?([^=\]]+)?=?([^\]]*)?\]/i", $node->$field, $match)) { + foreach ($match[3] as $key => $value) { + $match[1][$key] == '_pager' ? $pager = TRUE : $pager = FALSE; + $viewname = $match[2][$key]; + $limit = $match[3][$key]; + $view_args = $match[4][$key]; $view = views_get_view($viewname); $replace = ""; @@ -73,7 +74,7 @@ function _insert_view_substitute_tags(&$ // set $view->url to current page so views with exposed filters submit back to the same page $view->url = $_GET['q']; if (is_numeric($limit)) { - $replace = views_build_view('embed', $view, $view_args, FALSE, $limit); + $replace = views_build_view('embed', $view, $view_args, $pager, $limit); } else { $replace = views_build_view('embed', $view, $view_args, FALSE, NULL);