[英]Edit complete HTML of page in Drupal
We have our site running on Drupal. 我们的网站在Drupal上运行。 Now I have 2 landingpages: pages without menu's and a bit different in layout as the others.
现在我有2个登陆页面:没有菜单的页面,布局与其他页面略有不同。 I want to edit the complete HTML of the pages in the Drupal-interface, so marketeers can easily add HTML-snippets (for testing etc), without using a developer.
我想在Drupal界面中编辑页面的完整HTML,因此营销人员可以轻松添加HTML代码段(用于测试等),而无需使用开发人员。
How could I create an empty header and footer, and let the complete HTML be the content? 如何创建一个空的页眉和页脚,并让完整的HTML作为内容?
You could create a specific node type, and then use this function in your template.php : 您可以创建特定的节点类型,然后在template.php中使用此功能:
<?php
function theme_preprocess_page(&$variables)
{
if (isset($variables['node']->type))
{
$nodetype = $variables['node']->type;
$variables['theme_hook_suggestions'][] = 'page__' . $nodetype;
}
}
It will allows you to create templates for pages (Drupal is only offering this possibility for the page content) based on node types using page--node-type.tpl.php, so that you'll be able to customize the entire page html instead of just the content. 它将允许您使用page--node-type.tpl.php根据节点类型为页面创建模板(Drupal仅提供页面内容的这种可能性),以便您可以自定义整个html页面。而不只是内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.