dongxing8766 2013-12-11 09:34
浏览 21
已采纳

当我将这个php添加到pages.tpl.php时,为什么我的链接会中断

This is for my drupal site (qdin.me)... Ill give some background here, Im trying to have my exposed filters for a product search to appear in my main menu bar (using foundation theme).

I have gotten everything to be laid out how I want by editing the pages.tpl.php file and some css. I moved the header block region to be in the main menu. The filters work perfect, and the apply button works fine. But the links Here is orginal page.tpl.php (the relevant part anyway):

<?php if ($top_bar): ?>
  <!--.top-bar -->
  <?php if ($top_bar_classes): ?>
  <div class="<?php print $top_bar_classes; ?>">
  <?php endif; ?>
    <nav class="top-bar"<?php print $top_bar_options; ?>>
      <ul class="title-area">
        <li class="name"><h1><?php print $linked_site_name; ?></h1></li>
        <li class="toggle-topbar menu-icon"><a href="#"><span><?php print $top_bar_menu_text; ?></span></a></li>
      </ul>
      <section class="top-bar-section">
        <?php if ($top_bar_main_menu) :?>
          <?php print $top_bar_main_menu; ?>
        <?php endif; ?>
        <?php if ($top_bar_secondary_menu) :?>
          <?php print $top_bar_secondary_menu; ?>
        <?php endif; ?>

      </section>
    </nav>
  <?php if ($top_bar_classes): ?>
  </div>
  <?php endif; ?>
  <!--/.top-bar -->
<?php endif; ?>

And now here is after I edited

  <?php if ($top_bar): ?>
  <!--.top-bar -->
  <?php if ($top_bar_classes): ?>
  <div class="<?php print $top_bar_classes; ?>">
  <?php endif; ?>
    <nav class="top-bar"<?php print $top_bar_options; ?>>
      <ul class="title-area">
        <li class="name"><h1><?php print $linked_site_name; ?></h1></li>
        <li class="toggle-topbar menu-icon"><a href="#"><span><?php print $top_bar_menu_text; ?></span></a></li>
      </ul>
      <section class="top-bar-section">
        <?php if ($top_bar_main_menu) :?>
          <?php print $top_bar_main_menu; ?>
        <?php endif; ?>
        <?php if ($top_bar_secondary_menu) :?>
          <?php print $top_bar_secondary_menu; ?>
        <?php endif; ?>
        <?php if (!empty($page['header'])): ?>
          <?php print render($page['header']); ?>
        <?php endif; ?>
      </section>
    </nav>
  <?php if ($top_bar_classes): ?>
  </div>
  <?php endif; ?>
  <!--/.top-bar -->
<?php endif; ?>

Now I have tried wrapping each if in its own section, no dice. So i tried in divs instead still the links which are $linked_site_name (if you look at my site, youll see that "getQdin Commerce" isnt a link) and top_bar_secondary_menu are broken (you cant see this part if you look at my site right now). They don't even appear as a link). If i take this part out (the portion I added):

 <?php if (!empty($page['header'])): ?>
      <?php print render($page['header']); ?>
 <?php endif; ?>

The links work just fine.

This is hard to describe but the site title/link and my secondary menu, all end up appearing in the exposed filter's block.

  • 写回答

1条回答 默认 最新

  • doushao6874 2013-12-11 16:52
    关注

    The problem is with your CSS. The link is still actually there, but the form you've put in the header has some CSS that is overlapping the title and hiding the link.

    Specifically, it's this part in your CSS.

    .top-bar-section {
        left: 0;
        position: relative;
        transition: left 300ms ease-out 0s;
        width: auto;
    }
    

    The problem is the "left: 0" and "position: relative". Try removing those in the multiple CSS rules that you have set up for .top-bar-section and this should fix the problem. At least, it fixed it for me in Firebug when I removed them.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HC32L176调试了一个通过TIMER5+DMA驱动WS2812B
  • ¥15 三菱FX系列PLC串口指令
  • ¥15 cocos的js代码调用wx.createUseInfoButton问题!
  • ¥15 关于自相关函数法和周期图法实现对随机信号的功率谱估计的matlab程序运行的问题,请各位专家解答!
  • ¥15 Python程序,深度学习,有偿私
  • ¥15 扫描枪扫条形码出现问题
  • ¥35 poi合并多个word成一个新word,原word中横版没了.
  • ¥15 【火车头采集器】搜狐娱乐这种列表页网址,怎么采集?
  • ¥15 求MCSCANX 帮助
  • ¥15 机器学习训练相关模型