0

I created a view listing content type called stories. Then I created a block with this view.

In mytheme.info file I have this code :

regions[header] = Header
regions[story] = Story
regions[content] = Content

So I put the view into the Story region

I want to display the region into user-profile.tpl.php so I add this code :

<?php print render($page['story']); ?>

If everything work, it should display all the stories via the view.

I don't know why it does not work.

Thanks for your help !

1 Answer 1

0

If you would like to show blocks only on the profile page and not on the user/register or user/login or or user/*/edit, you can use the code for blocks visibility.

<?php
global $user;
if (arg(0) == 'user' && $user->uid == arg(1) && is_numeric(arg(1)) && (arg(2) == NULL) )
{
  return TRUE;
}

else {
  return FALSE;
}
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.