0

My html code:

<div class="workList col-lg-4">
  <div class="view-back">
    <a href="" target="_blank">&rarr;</a>
  </div>
<img class="img-responsive" src="<?php print base_path(). path_to_theme();?>/assets/images/img.jpg" alt="">
</div>

In views-view-fields--name--name.tpl I'm using this code:

<div class="view-back">
    <a href="" target="_blank">&rarr;</a>
</div>
<?php print $fields['field_fieldName']->content;?>

The generated output is the following.

<div class="col-lg-4  first odd">
      <div class="view-back">
    <a href="" target="_blank">→</a>
</div>
<div>## I have to remove this div
  <img typeof="foaf:Image" src="http://localhost/Drupal/name/sites/default/files/styles/recent_work/public/img.jpg?itok=vVkU2WWt" width="390" height="250" alt="">
</div>
</div>

I have to remove the default <div> before the <img> tag.

0

Click on field and edit settings Override style settings for field

Customize field HTML Customize field and label HTML

  • @ gfarishyan Thank you. Actually there is not printing an image. I am using <?php print $fields['field_fieldName']->content;?> Am I wrong?? – yuren Apr 18 '14 at 11:20
  • what is the output of print_r($fields['field_fieldName']) or even use dsm/dpm dpr if you enabled devel module ? – gfarishyan Apr 20 '14 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.