These are chat archives for adaptlearning/adapt_authoring

19th
Sep 2017
Muthu Pandiyan
@Muthughilli_twitter
Sep 19 2017 11:55
Hi Guys,
i am working on a requirement, every alternative blocks will have a background image.
what i thought is updating the model.schema to get image as input in the block area.
Muthu Pandiyan
@Muthughilli_twitter
Sep 19 2017 12:02
And, i thought, with the use of 'this.model.get('bgImage')', i can style the block using background-image property in the script file. but i dont know where can i do this.
Tom Taylor
@taylortom
Sep 19 2017 12:06
Hi @Muthughilli_twitter,
That should work if you use Asset:image as the input type
You’ll then have the bgImage attribute as an option on all blocks in the system, that may or may not be a problem
Anything that you add/change in the core schema files will be global
Muthu Pandiyan
@Muthughilli_twitter
Sep 19 2017 12:09
yeah,
i got that
i did it in that way only
but where can i access the attributte and write the coding for setting background
?
normally i used to write the code in the hbs file.
in my requirement i need to style the 'block' with background image property. but the hbs file for blocks is starting with 'block-inner' elmement.
image.png
Muthu Pandiyan
@Muthughilli_twitter
Sep 19 2017 12:14
refer the screenshot
in style attribute, i have to set 'background-image: url('someimg.png').
Tom Taylor
@taylortom
Sep 19 2017 12:27
the block view renders everything inside the top-level block, you won’t be able to access that from inside the handlebars
you’ll have to do it from the view.js, or make-do with the inner
Muthu Pandiyan
@Muthughilli_twitter
Sep 19 2017 12:46
are you reffering blockview.js
?
Tom Taylor
@taylortom
Sep 19 2017 13:23
Probably, I haven’t worked with the framework for a few years. Let me have a look
Tom Taylor
@taylortom
Sep 19 2017 15:28
Apologies @Muthughilli_twitter, got distracted :sweat_smile:
How did you get on?