I have a view in place that uses exposed filters in a block. In IE (7 & 8) once "Apply" is clicked the view does not show any results and the exposed filters are found over the view area (where they would be normally if not in a block) and also in the block. Everything works as it should (returning results and keeping the exposed filters in the block) in Firefox and in Chrome. The reason that it is breaking in IE is because I have added a view to the exposed form block via an appropriately named tpl file. Can anyone take a look at what I've done and let me know why it's not working in IE? I wish everyone would just switch to Firefox so I could stop dealing with these browser issues!!

// $Id: views-exposed-form.tpl.php,v 1.4 2008/05/07 23:00:25 merlinofchaos Exp $
/**
 * @file views-exposed-form.tpl.php
 *
 * This template handles the layout of the views exposed filter form.
 *
 * Variables available:
 * - $widgets: An array of exposed form widgets. Each widget contains:
 * - $widget->label: The visible label to print. May be optional.
 * - $widget->operator: The operator for the widget. May be optional.
 * - $widget->widget: The widget itself.
 * - $button: The submit button for the form.
 *
 * @ingroup views_templates
 */

if (!empty($q)):

    // This ensures that, if clean URLs are off, the 'q' is added first so that
    // it shows up first in the URL.
    print $q;
  

endif;

foreach($widgets as $id => $widget):
if (!empty($widget->label)):


print $widget->label;

endif;
if (!empty($widget->operator)):
print $widget->operator;

endif;

endforeach;

$viewName = 'user_gender_pref';
print views_embed_view($viewName);
print $button

?>

Comments

scalp’s picture

Title: Internet Explorer not displaying exposed filters in block properly » Embed view in exposed filters block
dagmar’s picture

Title: Embed view in exposed filters block » Embed view in exposed filters block problems in Internet Explorer
Category: bug » support
Status: Active » Postponed (maintainer needs more info)

If this is working in Firefox and Chrome probably is not a view bug.

You should, wrap your code in <code> </code> tags, we cannot see the complete tpl code.

scalp’s picture

Here's the code properly wrapped. I have it saved in the file views-exposed-form--search--default.tpl.php

<?php
// $Id: views-exposed-form.tpl.php,v 1.4 2008/05/07 23:00:25 merlinofchaos Exp $
/**
 * @file views-exposed-form.tpl.php
 *
 * This template handles the layout of the views exposed filter form.
 *
 * Variables available:
 * - $widgets: An array of exposed form widgets. Each widget contains:
 * - $widget->label: The visible label to print. May be optional.
 * - $widget->operator: The operator for the widget. May be optional.
 * - $widget->widget: The widget itself.
 * - $button: The submit button for the form.
 *
 * @ingroup views_templates
 */
?>
<?php if (!empty($q)): ?>
  <?php
    // This ensures that, if clean URLs are off, the 'q' is added first so that
    // it shows up first in the URL.
    print $q;
  ?>
<?php endif; ?>
<div class="views-exposed-form">
  <div class="views-exposed-widgets clear-block">
    <?php foreach($widgets as $id => $widget): ?>
      <div class="views-exposed-widget clear">
        <?php if (!empty($widget->label)): ?>
          <label>
            <?php print $widget->label; ?>
          </label>
        <?php endif; ?>
        <?php if (!empty($widget->operator)): ?>
          <div class="views-operator">
            <?php print $widget->operator; ?>
          </div>
        <?php endif; ?>
        <div class="views-widget-searchbox">
          <?php print $widget->widget; ?>
        </div>
      </div>
    <?php endforeach; ?>
<div class="gender-pref clear">
<?php
$viewName = 'user_gender_pref';
print views_embed_view($viewName);
?></div>
    <div class="views-exposed-widget">
      <?php print $button ?>
    </div>
  </div>
</div>
dawehner’s picture

Status: Postponed (maintainer needs more info) » Active

update

esmerel’s picture

Status: Active » Closed (cannot reproduce)

no activity in 6 months