Drupal - 替换主页 [英] Drupal - Replace the home page

查看:20
本文介绍了Drupal - 替换主页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨无论如何要阻止人们浏览 Drupal 主页并重定向到我的特定 html 页面?

谢谢

解决方案

如果您有特定的 HTML 页面,它位于服务器上并且不是从 Drupal 生成的,最简单的方法是使用 Drupal goto.

怎么做?打开你的 template.php 并搜索 page_preprocess 函数,它应该是这样的:

<前>你的主题_预处理(&$变量,$钩子){如果(drupal_is_front_page()){drupal_goto('yoursite.com/yourpage.html')}}

将 YOURTHEME 更改为您的主题名称并清除缓存.

真正的问题为什么要在主页上使用静态 HTML 文件?我会为主页创建一些文章或视图,并根据我喜欢的主题对其进行更改...这比任何其他选择都容易得多.

Hi Anyway to stop people browsing the Drupal home page and redirect to my specific html page?

Thanks you

解决方案

If you have specific HTML page that it is on the server and doesn't generated from Drupal, the most easy way is to use Drupal goto.

How to do it? open your template.php and search for page_preprocess function it should look like that:

YOURTHEME_preprocess(&$variables, $hook) {
  if( drupal_is_front_page()) {
      drupal_goto('yoursite.com/yourpage.html')
  }
}

change YOURTHEME to your theme name and clear the cache.

The real Question why should you use static HTML file for your homepage? I would create some article or view for homepage and change it as I like with theming... It is much easier than any other alternative.

这篇关于Drupal - 替换主页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆