简体   繁体   English

如何在 Drupal 8 的 404 页面上显示站点地图

[英]How to display sitemap on the 404 page in Drupal 8

I am trying display sitemap in my 404 page.我正在尝试在我的 404 页面中显示站点地图。 Could you recommended ways how can I display sitemap in my 404 page?你能推荐我如何在我的 404 页面中显示站点地图的方法吗?

At now I tried use a sitemap module.现在我尝试使用站点地图模块。 I created 404 node page and installed Drupal 8 sitemap module.我创建了 404 节点页面并安装了 Drupal 8 站点地图模块。 Then I created sitemap block in content region.然后我在内容区域创建了站点地图块。 If I browse /404 page then only my node text is displayed, but not block where supposed to be sitemap.如果我浏览 /404 页面,则只显示我的节点文本,但不会阻止应该是站点地图的位置。

Can I use some code?我可以使用一些代码吗?

If you go to /admin/config/system/site-information, on the bottom you can set your default 404 page.如果您转到 /admin/config/system/site-information,在底部您可以设置默认的 404 页面。 So you can create a page with your sitemap on in, or just put in the path of your current sitmemap.因此,您可以创建一个包含站点地图的页面,或者只是将其放入当前站点地图的路径中。

You have to to configure page which is available in this location /admin/config/system/site-information there you have to give the link for 404 add /sitemap link.您必须配置此位置中可用的页面/admin/config/system/site-information在那里您必须提供 404 add /sitemap链接的链接。 For reference i have attached Screen shoot.作为参考,我附上了屏幕截图。 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM