【发布时间】:2012-03-25 18:33:33
【问题描述】:
我想在 drupal 中呈现“基本页面”的内容。类似这样的问题:displaying a Drupal view without a page template around it 但对于 Drupal 7。
我的尝试几乎成功了:
function mytheme_preprocess_page(&$variables, $hook) {
if ( isset($_GET['ajax']) && $_GET['ajax'] == 1 ) {
$variables['theme_hook_suggestions'][] = 'page__ajax';
}
}
并且在 template.php 所在的同一目录中有一个名为 page--ajax.tpl.php 的文件:
<?php print $page['content']; ?>
问题是它仍然从侧边栏呈现菜单和我的两个自定义块。我只想要页面内容。我应该改变什么?
【问题讨论】:
标签: php drupal drupal-7 drupal-theming drupal-themes