I'd like to have a block only show up on the first page of my site home. As it stands, putting "front" page specific visibility settings puts the block on the site home, and all the other "sub-home" pages....i.e. my home page is a list of stories 5 pages long...I want the the block to show up only on the first page of the list of stories.

How do I go about this?

Comments

scoutbaker’s picture

Project: Deco » Drupal core
Version: 6.x-1.x-dev » 6.1
Component: User interface » block.module

Is this really related to the theme? I'm moving this over to core since it should be a function of block.module.

robloach’s picture

Status: Active » Fixed
if(drupal_is_front_page() && (isset($_GET['page']) ? ($_GET['page'] <= 1) : TRUE))
  return TRUE;
scoutbaker’s picture

Thanks for the update Rob.

robloach’s picture

That first TRUE in there should be a FALSE, I think.

ardarvin’s picture

Sorry, I'm a little new to PHP, and unfamiliar with the:

(x ? y : TRUE)

Syntax. Could someone explain to me what this does, i.e. what the "?" and ":" operators do?
Thanks.

ardarvin’s picture

Sweet...code works great, although I changed the "<=1" to "<1" because the code was showing on the first 2 pages. I guess page numbers are indexed from 0?

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.