How can I display images stored in the static forlder in a xblock template?
Thanks in advance
Hi @Javier_Arranz, welcome to the community!
You can find an existing example in our Problem Builder XBlock. It works this way:
- Use the local_resource_url method of the XBlock Runtime API to retrieve resource’s address (example).
- Pass the URL via
contextto the template instudent_view(example). - Use the variable inside the XBlock’s template (example).
Thanks. I when I do this the img is composed ok but it is not shown. The link appears to be broken
img src="/xblock/resource/clfclient/static/icons/back-016.png"