By loycossou on
Hello DrupWorld
I am neewbie too and try getting my project forward.
I need to display some blocks (or region) only on the front page. I want my frontpage be a summary of all my sub-pages. But when you klil on something, you shlould not see any more the same tabs...
How can i doo that please?
Comments
I think i got the solution
I have juste read the post http://drupal.org/node/338119. It's explained how to.
I must say that this is the how i fixed the issue but as i was not very sure, i wanted to ask you.
Hi, welcome to the Drupal
Hi, welcome to the Drupal community.
I think it's important for you to understand the difference between regions and blocks. A region is a container in your template. A block is a piece of content or functionality which can be placed in a region. A region can contain multiple blocks. The first question for you is: do you want to hide just the blocks (just the content of the region), or do you want to hide the complete region (so there is more space for the main content)?
If you just want to hide the blocks, you can configure each block and set the page specific visibility settings. Select the "Show on every page except the listed pages" radio button and add '' in the text area.
If you want to hide the whole region on your front page, there are a couple of options. Some themes automatically hide the region when there are no blocks in them. For instance, the popular Zen theme does this. If your theme behaves like this, you can just configure the page specific visibility settings of your blocks so they don't show up on the front page.
If your theme does not behave like this, you could hide the region in your page.tpl.php using some php. For instance:
so easy?
Hello
This made me smile.
So i was right to ask for.
I think there is a mistake. is it
if (!drupal_is_front_page()) {...or
if (drupal_is_front_page()) {...Thanks you.
Hello
It's even more easier,
you may use just variable $is_front in page.tpl.php
see http://api.drupal.org/api/file/modules/system/page.tpl.php/6
Julia
!$is_front
Ju is right,
$is_frontis even better because it saves a database call.The exclamation mark
!is not a mistake, is means "not". You want to show the region on all pages except the front page, so you want the $is_front to be false.In php,
if (!$is_front) { }means exactly the same as
if ($is_front == FALSE) { }