Make intro paragraph only appear on first page of a pager view

Linxor - April 14, 2009 - 05:33
Project:Viewfield
Version:5.x-1.5
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:by design
Description

Setup: I have a page with it's own title and body content, with an embedded view for articles. The body content is meant to be an introductory paragraph for the articles. The articles view displays 10 items at a time with a pager at the bottom.

Currently when the user clicks on a pager link to go to the next page, they see the body content (i.e. intro paragraph) at the top of the page followed by the next 10 articles.

Is there a way to make the body content disappear on subsequent pages -- i.e. make it only show on the first page? Is this possible with this module or any other module out there? I'm sure I can hack together something using hook_nodeapi(), but I'd prefer the easier route if there is one.

TIA.

#1

bcarlson33 - April 23, 2009 - 16:50

I'm looking to do almost exactly the same thing - my content is designed to show at the bottom of the first page of a view.

I tried putting the information in a block and then setting the block to only show on the name of the view, but it shows in all the succeeding pages because they all use the view name. I also thought of having the block set to not show on the succeeding pages, but then I'd have to exclude every page except the first and that's not workable.

Maybe we can start a support group. :)

#2

Darren Oh - May 20, 2009 - 14:03

Look at the URL. On every page after the first, you'll see something like "?page=1" or "?page=0,1". The page value is available in the PHP variable $_GET['page']. So make your intro block appear only when !isset($_GET['page']).

The official way to do this is not to use a pager. Add a block display to your view and set it to link to the page view. Then set the display format for the field to "Block". The block view will be displayed on your node page, and when a user clicks "more", they will be taken to the view page.

#3

Darren Oh - May 20, 2009 - 14:05
Status:active» by design
 
 

Drupal is a registered trademark of Dries Buytaert.