Community

[Solved] How to print pager for view in a block?

Hi Guys,

Been at this for ages (only a very low-level PHP skill), but have been copy/pasting/moving/hoping and can't get this to work.

I have a view of machine name: work_gallery_nodes, which shows nodes of content type "work-gallery", with a pager at the bottom to go to next node

How do I put that pager in a block?

I've tried Free Pager module, but it doesn't suit my need properly

I'm also tap tap tapping with this code from views-view.tpl.php:

<?php if ($pager): ?>
    <?php print $pager; ?>
  <?php endif; ?>

mixed with this from MerlinofChaos:

<?php
  $view
= views_get_view('my view');
  print
views_build_view(...necessary arguments...);
?>

But I am getting no where.

Thanks so much for any help.

Comments

Solved (I think)

So, here's my solution.

1) Get the view to work as expected.
2) Add display "Block" for the view.
3) Add views-view-VIEW-NAME-block.tpl.php to my theme folder.
4) Place the block where needed.
5) Leave only the print pager code in the tpl.php file.
6) Sit back and congratulate myself!

nobody click here