php - Drupal Zen 子主题,添加到标题区域下方的标题内容

标签 php css drupal zen

我在 Zen 7.x-5.4 子主题中使用 Drupal 7。我试图在标题/横幅区域内添加一个主导航栏,位于底部 Logo 的右侧。

我没有使用标题下方提供的“导航”区域。相反,我添加了一个菜单 block 并将其放置在“标题”区域中。不幸的是,它出现在标题和 Logo 下方。

这是输出的相关 html:

<header id="header" class="header" role="banner">
    <a id="logo" class="header__logo" rel="home" title="Home" href="/sandbox/">
    <nav id="secondary-menu" class="header__secondary-menu" role="navigation">{this menu works fine}
    <div class="header__region region region-header">
        <div id="block-menu-menu-primary-nav" class="block block-menu first last odd"      role="navigation">
            <h2 class="block__title block-title">Primary Nav</h2>
            <ul class="menu">{menu list here}</ul>
        </div>
    </div>
</header>

不在我想要的位置的菜单位于 region-header 类中。每当我在 zen 界面中向“标题”添加一个 block 时,它都会在该类中结束并出现在标题下方,而不是在其中。默认情况下位于标题中的二级菜单很好,并且恰好位于应有的位置。当前没有为区域 header 定义的 css。 header 的高度为 120px,并且有足够的空间用于我想做的事情。 page.tpl.php 仅提供“print render($page['header']);”所以我似乎没有任何控制权。

我有两个问题:

我怎样才能把这个菜单放在我想要的标题中?

如何让它隐藏菜单 block 上的“主导航”标题?创建菜单 block 时需要标题,但似乎没有使其不可见的方法。

如果需要任何更具体的信息来回答这些问题,请告诉我。

而且,是的,我知道有人问过类似的问题,但它们似乎适用于 Zen 的其他版本,而且我发现没有一个有任何帮助。

最佳答案

它永远不会失败。 3 天前,我一直在尝试在发布问题之前弄清楚这一点,并且在我发布后,我就弄清楚了。

misc.css 中有一个 css block ,内容如下

/* Wrapper for any blocks placed in the header region. */
.header__region {
  /* Clear the logo. */
  clear: both;
}

我只需要注释掉“clear: both;”行,因为那不允许任何其他内容 float 在 Logo 旁边。

我可以通过转到“配置 block ”并在标题中添加“”来覆盖创建菜单时所需的标题,从而删除菜单标题。

希望这对某人有用。

关于php - Drupal Zen 子主题,添加到标题区域下方的标题内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21995824/

相关文章:

php - 拉拉维尔 5.4 : Translate routes

php - 单击登录表单中的提交会重定向到index.php并且不会登录

html - 我很难在其父 div 内垂直对齐 nav 元素。

drupal - Drupal 8 中的文档管理

德鲁帕尔 6 : Drupal Themer gives same candidate name for different type of content types

php - wordpress在自定义页面上传图片

php - org.json.JSONException : Value Connected of type java. lang.String 无法转换为 JSONObject

html - Google 字体名称中带有空格,在 HTML 中正确的引用方式是什么?

html - 根据动态高度的图像设置高度

php - 将站点从 Drupal 移动到原始 PHP ...错误 : Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)