当我将这个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.

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.