Skip to main content
Commonmark migration
Source Link

I have a related content section on my page through views in which i want one field to be a div with a background-image.

Ok, then you can use Image URL Formatter. Which will output your image as a url instead of the actual image.

Then add the image field, which contains the image you want to use as background

  • Hide it from display.
  • Select image url as your formatter

Add a custom field OR Rewrite the result of an existing field and use the image replacement pattern.

ex <img class="[YOUR CLASS]" src="{{ field_image }}">

OR if you create a .html.twig template file for your view, then you can use

<div class="[YOUR CLASS]" style="background-image: url('{{ field_image }}')"></div>


###Another option

Another option

In Style settings you can add a class to your fields.

[enter image description here

Then with css give it a z-index: 0; and give everything else z-index: 1; and move img around by giving it position: absolute; top: -100px; etc..

I have a related content section on my page through views in which i want one field to be a div with a background-image.

Ok, then you can use Image URL Formatter. Which will output your image as a url instead of the actual image.

Then add the image field, which contains the image you want to use as background

  • Hide it from display.
  • Select image url as your formatter

Add a custom field OR Rewrite the result of an existing field and use the image replacement pattern.

ex <img class="[YOUR CLASS]" src="{{ field_image }}">

OR if you create a .html.twig template file for your view, then you can use

<div class="[YOUR CLASS]" style="background-image: url('{{ field_image }}')"></div>


###Another option

In Style settings you can add a class to your fields.

[enter image description here

Then with css give it a z-index: 0; and give everything else z-index: 1; and move img around by giving it position: absolute; top: -100px; etc..

I have a related content section on my page through views in which i want one field to be a div with a background-image.

Ok, then you can use Image URL Formatter. Which will output your image as a url instead of the actual image.

Then add the image field, which contains the image you want to use as background

  • Hide it from display.
  • Select image url as your formatter

Add a custom field OR Rewrite the result of an existing field and use the image replacement pattern.

ex <img class="[YOUR CLASS]" src="{{ field_image }}">

OR if you create a .html.twig template file for your view, then you can use

<div class="[YOUR CLASS]" style="background-image: url('{{ field_image }}')"></div>


Another option

In Style settings you can add a class to your fields.

[enter image description here

Then with css give it a z-index: 0; and give everything else z-index: 1; and move img around by giving it position: absolute; top: -100px; etc..

added 69 characters in body
Source Link
No Sssweat
  • 31.6k
  • 14
  • 55
  • 91

I have a related content section on my page through views in which i want one field to be a div with a background-image.

Ok, then you can use Image URL Formatter. Which will output your image as a url instead of the actual image.

Then add the image field, which contains the image you want to use as background

  • Hide it from display.
  • Select image url as your formatter

Add a custom field OR Rewrite the result of an existing field and use the image replacement pattern.

ex: <div<img class="[YOUR CLASS]" style="background-image: url('src="{{ field_image }}')"></div>">

orOR if you create a .html.twig template file for your view, then you can use

<img<div class="[YOUR CLASS]" src="style="background-image: url('{{ field_image }}">')"></div>


###Another option

In Style settings you can add a class to your fields.

[enter image description here

Then with css give it a z-index: 0; and give everything else z-index: 1; and move img around by giving it position: absolute; top: -100px; etc..

I have a related content section on my page through views in which i want one field to be a div with a background-image.

Ok, then you can use Image URL Formatter. Which will output your image as a url instead of the actual image.

Then add the image field, which contains the image you want to use as background

  • Hide it from display.
  • Select image url as your formatter

Add a custom field OR Rewrite the result of an existing field and use the image replacement pattern.

ex: <div class="[YOUR CLASS]" style="background-image: url('{{ field_image }}')"></div>

or <img class="[YOUR CLASS]" src="{{ field_image }}">


###Another option

In Style settings you can add a class to your fields.

[enter image description here

Then with css give it a z-index: 0; and give everything else z-index: 1; and move img around by giving it position: absolute; top: -100px; etc..

I have a related content section on my page through views in which i want one field to be a div with a background-image.

Ok, then you can use Image URL Formatter. Which will output your image as a url instead of the actual image.

Then add the image field, which contains the image you want to use as background

  • Hide it from display.
  • Select image url as your formatter

Add a custom field OR Rewrite the result of an existing field and use the image replacement pattern.

ex <img class="[YOUR CLASS]" src="{{ field_image }}">

OR if you create a .html.twig template file for your view, then you can use

<div class="[YOUR CLASS]" style="background-image: url('{{ field_image }}')"></div>


###Another option

In Style settings you can add a class to your fields.

[enter image description here

Then with css give it a z-index: 0; and give everything else z-index: 1; and move img around by giving it position: absolute; top: -100px; etc..

added 227 characters in body
Source Link
No Sssweat
  • 31.6k
  • 14
  • 55
  • 91

I have a related content section on my page through views in which i want one field to be a div with a background-image.

Ok, then you can use Image URL Formatter. Which will output your image as a url instead of the actual image.

Then add the image field, which contains the image you want to use as background

  • Hide it from display.
  • Select image url as your formatter

Add a custom field OR Rewrite the result of an existing field and use the image replacement pattern.

ex: <div class="[YOUR CLASS]" style="background-image: url('{{ field_image }}')"></div>

or <img class="[YOUR CLASS]" src="{{ field_image }}">


###Another option

In Style settings you can add a class to your fields.

[enter image description here

Then with css give it a z-index: 0; and give everything else z-index: 1; and move img around by giving it position: absolute; top: -100px; etc..

I have a related content section on my page through views in which i want one field to be a div with a background-image.

Ok, then you can use Image URL Formatter. Which will output your image as a url instead of the actual image.

Then add the image field, which contains the image you want to use as background

  • Hide it from display.
  • Select image url as your formatter

Add a custom field OR Rewrite the result of an existing field and use the image replacement pattern.

ex: <div class="[YOUR CLASS]" style="background-image: url('{{ field_image }}')"></div>

or <img class="[YOUR CLASS]" src="{{ field_image }}">


I have a related content section on my page through views in which i want one field to be a div with a background-image.

Ok, then you can use Image URL Formatter. Which will output your image as a url instead of the actual image.

Then add the image field, which contains the image you want to use as background

  • Hide it from display.
  • Select image url as your formatter

Add a custom field OR Rewrite the result of an existing field and use the image replacement pattern.

ex: <div class="[YOUR CLASS]" style="background-image: url('{{ field_image }}')"></div>

or <img class="[YOUR CLASS]" src="{{ field_image }}">


###Another option

In Style settings you can add a class to your fields.

[enter image description here

Then with css give it a z-index: 0; and give everything else z-index: 1; and move img around by giving it position: absolute; top: -100px; etc..

Post Undeleted by No Sssweat
added 46 characters in body
Source Link
No Sssweat
  • 31.6k
  • 14
  • 55
  • 91
Loading
Post Deleted by No Sssweat
Post Undeleted by No Sssweat
Post Deleted by No Sssweat
Source Link
No Sssweat
  • 31.6k
  • 14
  • 55
  • 91
Loading