Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By openbayou on
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_page
on 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
In the block settings you
In the block settings you can limit it to the path "
<front>
" (don't enter the double quotes)Fixed missing path
example
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
Go to the block admin page.
Go to the block admin page. Find the block. Click 'configure'. Select 'show only on the given paths'. add <front> and save.
doesn't work
Doesn't work. This is what I have so far.
This is the setup
tried it, not working
For some reason, my first post was edited and it removed
<front>
. That does not work.That should not happen. I
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>
I agree. If the block is
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.
Something else to check is to
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?
reset
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.
have you written the pages in
have you written the pages in each line like
node/1
node/2
node/3
how?
node/1, node/2, node/3 goes to the individual posts. Pages are node?page=0, node?page=1. How do you change it?
Redo
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.
If you are using ajax to load
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.
"<front>" restriction not working
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.
Same problem
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/ ?