Link to home
Start Free TrialLog in
Avatar of mrroy69
mrroy69

asked on

How to remove Extra <div> </div> In Drupal Views

Greetings  I've setup a view and tried to stripout most of the unwanted html from the default view template, so I created a template:
 views-view--xxx.tpl.php in in there all I have is the following

<?php print $header; ?>
<?php print $rows; ?>
<?php print $footer; ?>

Drupal still adds a wrapper_prefix (<div>) and wrapper_suffix (</div> to each row, even though I've unchecked every box that woould add a wrapper that results in:

<div>
mycode
</div>

<div>
my code
</div>

I've tried everything I know to get rid of those pesky <div></div> but no luck. Any help is appreciated. Thanks
ASKER CERTIFIED SOLUTION
Avatar of mrroy69
mrroy69

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mrroy69
mrroy69

ASKER

:)
Views has tpls that are in use for rendering the view, each row, and each field. You can see which tpls are available for your view by viewing the "Theme: Information" on your view configuration page under the "advanced" section. Look in your Views module directory for a "theme" directory. This will contain all of the default tpl files. See descriptions of the files here. Which one you need to use will depend on which row style you are using in your view configuration. For example, ff you are displaying your rows as fields, you'll want to copy the views-view-fields.tpl.php file into your theme directory and rename it to views-view-fields--xxx.tpl.php replacing the xxx with the machine name of the view you wish to modify.

Be sure to flush your Drupal caches after adding or changing these files so that Drupal will apply them.
Oops... seems I was late to the party :)
Avatar of mrroy69

ASKER

Thanks yes. Once I added my new tpl I re-scanned the template files to make sure mine was being used for the output, and then flushed the caaches...Do you know of a similar way to do that with the panels output :)