You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Convert BuiltIn Video Block's html from mako template into django template #427
In this ticket we have to convert the BuiltIn Video Block's html from mako template to django template.
Reasons:
We are parting ways with the mako template
Eventually we have to extract out the Video Block into xblocks-contrib repository
Acceptance Critieria:
html template should be refactored to django template with minimal code changes
Video XBlock experience shouldn't be changed
All unit and karma test cases should be passed on the edx-platform
Further details:
Major work of it has already been done in this PR
Rational is to convert it within edx-platform and ship the task individually to the production.
After that changes will removed from shared video xblock extraction PR.
changed the title [-]Convert mako template into Django Template[/-][+]Convert BuiltIn Video Block's html from mako template into django template[/+]on Oct 15, 2025
To render the dango template in video_block I tried two approaches.
In the first approach, I tried using the resource loader’s method to render the Django template, similar to how it’s used in item_bank_block.
However, this approach did not work because the resource loader couldn’t locate the HTML file in the lms/templates directory, as we’re rendering it from within the XModules.
In the second approach, I used Django’s built-in render_to_string method to render the template. It successfully found and rendered the file on the LMS, but not on the CMS.
With this approach i have created draft PR.
The reason the file renders successfully in the LMS but not in the CMS is that video.html is available under lms/templates, and render_to_string can find it there. However, in the CMS, the file is not available.
As per my understanding, we need to update the template path in the CMS settings so that it can locate and render the video.html file.
During manual testing i noticed there is a console error appearing although things are apparently working. I moved my PR back to draft from review and moving this ticket into progress again. Looking into detail why this is happening.
As per my understanding when i converted the tabs-aggregator.html template into django template and render it in studio_view method as django template it is not rendering properly and instead of responding with json it is responding with html, which is creating error in video.js on micro frontend.
As there is already deprecation ticket to remove legacy video editor so i reverted my changes instudio_view to unblock my ticket.
Activity
[-]Convert mako template into Django Template[/-][+]Convert BuiltIn Video Block's html from mako template into django template[/+]salman2013 commentedon Oct 22, 2025
To render the dango template in video_block I tried two approaches.
In the first approach, I tried using the resource loader’s method to render the Django template, similar to how it’s used in item_bank_block.
However, this approach did not work because the resource loader couldn’t locate the HTML file in the lms/templates directory, as we’re rendering it from within the XModules.
In the second approach, I used Django’s built-in render_to_string method to render the template. It successfully found and rendered the file on the LMS, but not on the CMS.
With this approach i have created draft PR.
The reason the file renders successfully in the LMS but not in the CMS is that video.html is available under lms/templates, and render_to_string can find it there. However, in the CMS, the file is not available.
As per my understanding, we need to update the template path in the CMS settings so that it can locate and render the video.html file.
salman2013 commentedon Nov 8, 2025
During manual testing i noticed there is a console error appearing although things are apparently working. I moved my PR back to draft from review and moving this ticket into progress again. Looking into detail why this is happening.
salman2013 commentedon Nov 11, 2025
The above mention issue was occurring on MFE forntend-app-authoring .
As per my understanding when i converted the
tabs-aggregator.htmltemplate into django template and render it instudio_viewmethod as django template it is not rendering properly and instead of responding with json it is responding with html, which is creating error in video.js on micro frontend.As there is already deprecation ticket to remove legacy video editor so i reverted my changes in
studio_viewto unblock my ticket.salman2013 commentedon Nov 11, 2025
PR for this Ticket: openedx/openedx-platform#37509
refactor: Convert BuiltIn Video Block's html from mako to django temp…
refactor: Convert BuiltIn Video Block's html from mako to django temp…