I want to show a block on only the homepage. I select "Show on only the listed pages" and I write "" in the "Pages:" box.

But my block is showed on all of pages ending with /?page=1.
http://mysite.com/?page=1
http://mysite.com/?page=2
http://mysite.com/?page=3
.
.
.
http://mysite.com/?page=1000

They are links at the end of the homepage. How can show a block on only the homepage?

Comments

newbii’s picture

I write < front > into the box.

teyser’s picture

Hi,
You write page-front.tpl.php in drupal theme.And the configure in block page you are giving .If it's not working properly means write a php code.

Thanks,
Sudalai Raj.t
Do u wnat any further info plz contact my personal mail ID:
sudalai_raju@indiatimes.com

newbii’s picture

< > is enough ?

I think < front > doesn't mean homepage. I changed it as < > . It seems that it works.

newbii’s picture

Sorry < > doesn't work. Block doesn't show on any page.

lrickard’s picture

It seems like you're doing the right things:
1) Check "Show on only the listed pages"
2) Write <front> into the "pages" box.

Make sure you write <front> without any spaces.
Also: on the main "Blocks" page, make sure you've selected a region from the drop down menu for your block, and clicked "Save blocks" at the bottom of the page. If you don't click "Save blocks," Drupal won't turn the block on.

newbii’s picture

Yes I write < front > without space. But in this forum, I had to add spaces. Because it is not showed in my posts.

I save the block as well. But the block is not showed on only the homepage. It is showed on also the mysite.com/?page=1 , mysite.com/?page=2, mysite.com/?page=3, ...

I placed an advertisement code in the block. My advertisers want their ads on only the homepage or on only 1 page. But currently their ads are showed on more than 1 page. The explanation is wrong at the block module. < front > doesn't mean homepage. I don't know how can I show the block on only 1 page, homepage.

lrickard’s picture

That's weird that it displays on all other pages, but NOT on the front page. From that behavior, it sounds like the "Show on every page except the listed pages" options is selected. Would you please double check that "Show on only the listed pages" is selected, and report back?

newbii’s picture

I select "Show on only the listed pages". My problem can be <front>.

In the Administer>Site information, an option is given to determine a homepage by "Default front page:" There is a sentence recommends to use "node" :
"The home page displays content from this relative URL. If unsure, specify "node"."

The problem can be that "node" is not only the homepage, it is also mysite.com/node?page=1,2,3,....
Those weird pages are redirected to mysite.com/?page=1,2,3,..

I can't find the exact path name of my homepage. This is the main problem. It is also very interesting. "node" and "front" mean many pages including the homepage. I am looking for my homepage and can't find it.

FatPitchFinancials’s picture

I have the exact same problem at my site. I too have the default "node" set as the front page. When I try to set <front> for a block's visability, the block also appears on pages 2,3,4...

I hope you or someone else finds a solution.

FatPitchFinancials’s picture

I just figured out a solution to this problem, I think. I changed my homepage from the default "node" to "node/" in Site Information, and now <front> actually works as advertised. My block now only appears on the actual homepage. Page 2,3,4... no longer shows the block that I set to be visible only on the front page.

I hope that setting "node/" to my default front page does not cause any other issues. Please let me know if it will.

I hope this helps others.

newbii’s picture

node/ solved the problem. Your solution is great. Thank you very much.

newbii’s picture

I noticed that I have 2 front pages after I set up the front page as "node/"
In addition, the block also appear on the pages mysite.com/?page=1,2,3,4...

If I set my front page as "node", "mysite.com/node?page=1" is redirected to "mysite.com/?page=1"

So, now I have 2 homepages and 2 x node pages. This is too bad for SEO.
Sorry but the problem was not solved.

I have also checked ".htacces" file for any possible solution and I saw that these don't work for me;

# Rewrite old-style URLs of the form 'node.php?id=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^id=([^&]+)$
#RewriteRule node.php index.php?q=node/view/%1 [L]

We tried for many hours but were not able to find the exact front page of this Drupal 5.10 site.

AgentD’s picture

Same problem.

I have blocks set to only appear on < front > (without spaces of course) but they appear on multiple pages (node?page=1...).

Anyone found a way to prevent that from happening? < front > really should limit a block to just the front page.

Dan