Comments Matt Laws started the conversationApril 16, 2020 at 4:58pmHiya, 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,194Amit repliedApril 17, 2020 at 8:54amthis is how u use the background attribute 1 LikeMatt Laws repliedApril 17, 2020 at 9:19amThanks, 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,194Amit repliedApril 17, 2020 at 9:22amI am sorry i lost u but if u need any other help i am here to support you. Matt Laws repliedApril 17, 2020 at 9:35amOk, 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,194Amit repliedApril 17, 2020 at 9:37amyou want the background to be a solid color ?Matt Laws repliedApril 17, 2020 at 9:37amNo, I need images (I'm using SVG shapes) 1,194Amit repliedApril 17, 2020 at 9:39amare u sure svg shape supports a image background . can u make your example in codepen first ?Matt Laws repliedApril 17, 2020 at 9:40amSVG is supported once WordPress is changed with a plugin, I'll make a codepen sure. Give me a few minutes :)Matt Laws repliedApril 17, 2020 at 9:51amHeres the pen:-https://codepen.io/Neurojazz/pen/abvNGPO 1,194Amit repliedApril 17, 2020 at 9:55amthis image will be editable ?its not static ? 1,194Amit repliedApril 17, 2020 at 9:55amthis one i mean https://svgur.com/i/K9d.svgMatt Laws repliedApril 17, 2020 at 9:56amStatic, but can't be part of the main image in background (Trying to make nice responsive sections) 1,194Amit repliedApril 17, 2020 at 10:06amok got it so what u dont know is how to make an assets path if i understand correctly1 LikeMatt Laws repliedApril 17, 2020 at 10:10amOk, I understand now - I can't add these via the editor, I have to embed them & hardcode. No problem! Thanks for your time :) 1,194Amit repliedApril 17, 2020 at 10:11ambut do u know how to create an assets path?1 LikeMatt Laws repliedApril 17, 2020 at 10:12amYep, found the video :) Sign in to reply ...
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?
this is how u use the background attribute
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!!!!
I am sorry i lost u but if u need any other help i am here to support you.
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! :)
you want the background to be a solid color ?
No, I need images (I'm using SVG shapes)
are u sure svg shape supports a image background . can u make your example in codepen first ?
SVG is supported once WordPress is changed with a plugin, I'll make a codepen sure. Give me a few minutes :)
Heres the pen:-
https://codepen.io/Neurojazz/pen/abvNGPO
this image will be editable ?
its not static ?
this one i mean
https://svgur.com/i/K9d.svg
Static, but can't be part of the main image in background (Trying to make nice responsive sections)
ok got it so what u dont know is how to make an assets path if i understand correctly
Ok, I understand now - I can't add these via the editor, I have to embed them & hardcode. No problem! Thanks for your time :)
but do u know how to create an assets path?
Yep, found the video :)