How to restore default homepage?

旧时模样 提交于 2019-12-23 03:32:35

问题


I'm new to Drupal, and cannot understand how to do this: I must have accidentally deleted the default home page in my test site, and cannot find a way to restore it.

I see I can create a new basic page and set it as my new home, however this is missing something - for example it does not show latest articles with the "main page content" system block, even if I set this new page as the homepage in site settings.

Should I do something more to let Drupal know this is actually an homepage? And isn't there a way to restore the original default home page? If I delete the custom page and let the default home empty in site settings I'm now sent to the login page, or to my user profile if I'm logged-in.

Thanks for any help, al.


回答1:


The default front page in Drupal 8 is actually not a page (a node) but a View.

Please, check out if Views and Views UI modules are enabled (Manage/Extend from admin menu).

If both of them enabled, then inspect all your current Views (Manage/Structure/Views). There should be one with a name "Frontpage".

If this "Frontpage" View exists and enabled, then set Default front page to /node in your site's settings (Manage/Configuration/Basic sites settings).

If this "Frontpage" View exists but disabled, then enable it.

If this "Frontpage" View does not exist, then you've probably deleted it and have 3 options to restore it:

  1. Create a new View which would work just as default original "Frontpage" View that have been deleted. You can create a new test site and just use its settings as a reference ("Frontpage" View will be available after a clean "standard" install).
  2. If you did not create any new Views or modify existing, then the best choice will be just unistalling/installing Views/Views UI modules. It will refresh all settings (i. e. all custom Views or settings will be missed, all default predefined Views will be restored).
  3. Not recommended. You can create a new Drupal fresh site, make Drupal believe that this new install is actually a copy of your current site, and then you can just export/import this "Frontpage" View from new install to your current site using core module "Configuration Manager". More on this: https://drupal.stackexchange.com/a/150609



回答2:


To set new frontpage from you node Administration -> configuration -> system

Front-Page -> Default front page and set path to you page....



来源:https://stackoverflow.com/questions/38371250/how-to-restore-default-homepage

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!