3

I use the Image URL Formatter module for my custom Views. The Views settings look like so:

Setting field:

Setting field

Setting custom text:

enter image description here

This is the result I get:

enter image description here

Inspect html

<div class="views-field views-field-nothing"><span class="field-content">
<div>
http://example.com/sites/default/files/color-placeholder/team-1.jpg
)"&gt;
  <ul class="social-team"><li><a class="fa fa-facebook" href="#"></a></li>
    <li><a class="fa fa-instagram" href="#"></a></li>
    <li><a class="fa fa-twitter" href="#"></a></li>
    <li><a class="fa fa-github" href="#"></a></li>
    </ul>
  <a href="/md8/features/kate-benke" hreflang="en">Kate Benke</a>
  Back-End Developer
</div>
</span></div>

How should I correct my config to use mage URL?

Note: I don't want override template.

1 Answer 1

2

Views field strips out <div style=".."> tag. To add background image you need to follow below steps:

  1. Add global custom field into view header and put below code.
<style type="text/css">
    .background-img { 
      background: url('{{ field_photo_team }}'); 
    }  
</style>
  1. Now assign background-img class to Global :Custom text field like

.

<div class="background-img">
{{ field_social }}
{{ title}}
{{ field_profession_team }}
</div>

Note: Use Global Text Area in view header and select an input filter where html tags aren't limited i.e. full html text format

4
  • Sorry, i config same way, but return same result. Do you try it?
    – user62538
    Commented Nov 17, 2016 at 5:07
  • I have just modified the answer, please try out. Commented Nov 17, 2016 at 5:35
  • @John did you try adding the quotes ' ' wrapping the url?
    – No Sssweat
    Commented Nov 17, 2016 at 6:53
  • @NoSssweat yes, he tried quotes ' ', but no luck. Hence I have modified the answer. Commented Nov 17, 2016 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.