Hi,

I have a view that saved as a block, how do I make it only display the block on the front page? I've tried and drupal_is_front_pageon show block on specific pages and it either display the block on all pages or removes the block. Any suggestions on what to do? I also have a view as the front page called /frontpage.

Comments

nevets’s picture

In the block settings you can limit it to the path "<front>" (don't enter the double quotes)
Fixed missing path

openbayou’s picture

I'm very new to Drupal. Do I make the path to the block? If so, how I find out what the path is? I don't know if this helps but my this is my URL for index: /frontpage, frontpage?page=0

Jaypan’s picture

Go to the block admin page. Find the block. Click 'configure'. Select 'show only on the given paths'. add <front> and save.

openbayou’s picture

Doesn't work. This is what I have so far.

This is the setup

openbayou’s picture

For some reason, my first post was edited and it removed <front>. That does not work.

bjmagar1906’s picture

That should not happen. I think you might have deleted block or views that created the block. As Jaypan or other members have already suggested just adding path as <front> in the block configuration visibility setting should work. You have to select "Only the listed pages" under "Show block on specific pages " section and add path as <front>

Jaypan’s picture

I agree. If the block is still showing up on other pages after doing this, then you've got some custom code that is doing something funny, or you've got a contributed module (from Drupal.org) that is doing something funny. Start disabling modules and re-testing until the block disappears from other pages (then you'll know which module is causing the issue). You'll also want to try another theme to see if the problem is in your theme. You should actually do this before checking modules.

nevets’s picture

Something else to check is to visit "Configuration" >> "Site Information" and the setting for "Default front page". Is it set to "frontpage", the path for your view?

openbayou’s picture

What I did: nuked my setup, downloaded 7.38, installed 7.38 with minimum settings, used the garland theme, added 6 posts with 3 posts per page in articles content type, moved power by drupal blocked to the footer region, added to only the listed pages. Still on every page! Cleared cache, still there.

tatha.bh’s picture

have you written the pages in each line like
node/1
node/2
node/3

openbayou’s picture

node/1, node/2, node/3 goes to the individual posts. Pages are node?page=0, node?page=1. How do you change it?

openbayou’s picture

So it looks like front is for all pages. What I'll do is load more posts with ajax. Thanks for answering all of my questions.

tatha.bh’s picture

If you are using ajax to load contents in the front page, then your block will display there everytime. I guess there is no way to restrict that.

emb03’s picture

nm, I installed form mode manager and they hijacked by home page in site settings. When I changed this back to the proper node everything worked as normal.

Akram-Pk’s picture

I am having same problem when I use <front> block disappears from front page too

I have installed theme DXPR 1.2.6 and bootstram 3 come along. and a bootstrap view module. 

I wonder what is causing this problem. besides is there any other way to mentioned front page? i.e. mysite.com/ ?