Drupal - 更换主页 [英] Drupal - Replace the home page
问题描述
您好
无论如何阻止浏览Drupal主页并重定向到我的特定html页面的人?
谢谢你
如果您在服务器上有特定的HTML页面,并且不会从Drupal生成,最简单的方法是使用Drupal goto。 >
如何做?打开你的template.php并搜索page_preprocess函数,它应该是这样的:
YOURTHEME_preprocess(&$ variables,$ hook){
if(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屋!