I am using the module Simple Background Image Formatter to convert an image into a div background image. It has two options - one to put as an inline style of a div or to choose a CSS selector which it styles with a background image in the DOM. I cannot use the inline style method in views so that is ruled out. Now as per the CSS selector method, it adds a style directly on the page with the 'selectedclass_id'. I can choose the selectedclass but not the id (appears to be randomly added).
However, since my requirement is through views, it somehow (although with wierd settings) automatically prints the class and adds the id, however, the image for other nodes is not loaded in this node as its html style in not loaded in the current page. That is, the image of every page is converted into a selectedclass_id (background-image:...) and placed in the html of that page but the selectedclass_id of the other nodes which are part of the view in this page are not loaded here with their respective values. Therefore, these images are not being displayed in the view.
Is there a solution here? I want the page to load the css selectors for the nodes which are shown in the view (of the same content type) so that the code for each of the view fields is where the id will be different for each of the nodes. The current page should have the values of all such nodes in the view as it does with regard the value of the current page. Presently, only the selectedclass_id of the current page is being loaded in the head html style.
An alternative for the module is Background Images Formatter but this is dependent on bg_image which does not have a Drupal 8 version and doesn't work without it.