Okay
  Public Ticket #2364939
CSS issue
Closed

Comments

  • Matt Laws started the conversation

    Hiya, 

    I've trying to create a custom widget, but can't set an attribute for backgrounds. It won't let me create something like this in the css:-

    background-image: url({{image}});

    And the widget breaks on the front end.

    Is there a way to get the 'background selector' type in attributes? (to be able to pick image/colour or gradient?


  •  1,175
    Amit replied

    this is how u use the background attribute 


  • Matt Laws replied

    Thanks, I was an idiot... It didn't show 'image' under the background option in the widget and presumed it wouldn't be on the front end ;) 

    Many thanks!!!!

  •  1,175
    Amit replied

    I am sorry i lost u but if u need any other help i am here to support you. 


  • Matt Laws replied

    Ok, I've followed the video, but it only lets me create a background for the whole widget. I need to layer backgrounds.

    For example I need to apply backgrounds to the widget (which your method works) and a div (ML_AS_left_div) above:-

    <div class="ML_AS_container">
      
     <div class="ML_AS_left_div">
       
      </div><!--end of left div-->
      
      
      <div class="ML_AS_right_div">
        
      </div><!--end of right div-->
      
      
    </div><!--end of container-->


    I'm trying to make an angled section like one of yours, but with more flexibility. I can send images of the concept if the problem isn't clear! :)


  •  1,175
    Amit replied

    you want the background to be a solid color ?


  • Matt Laws replied

    No, I need images (I'm using SVG shapes)

  •  1,175
    Amit replied

    are u sure svg shape supports a image background . can u make your example in codepen first ?


  • Matt Laws replied

    SVG is supported once WordPress is changed with a plugin, I'll make a codepen sure. Give me a few minutes :)

  •  1,175
    Amit replied

    this image will be editable ?

    its not static ?


  •  1,175
  • Matt Laws replied

    Static, but can't be part of the main image in background (Trying to make nice responsive sections)

  •  1,175
    Amit replied

    ok got it so what u dont know is how to make an assets path if i understand correctly


  • Matt Laws replied

    Ok, I understand now - I can't add these via the editor, I have to embed them & hardcode. No problem! Thanks for your time :)

  •  1,175
    Amit replied

    but do u know how to create an assets path?


  • Matt Laws replied

    Yep, found the video :)