Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.

feat: added new setting CUSTOM_RESOURCE_TEMPLATES_DIRECTORY - #189

Merged
keithgg merged 1 commit into
opencraft-release/lilac.2-esmefrom
keith/bb_5885_esme
Apr 5, 2022
Merged

feat: added new setting CUSTOM_RESOURCE_TEMPLATES_DIRECTORY#189
keithgg merged 1 commit into
opencraft-release/lilac.2-esmefrom
keith/bb_5885_esme

Conversation

@keithgg

@keithgg keithgg commented Apr 4, 2022

Copy link
Copy Markdown

Cherry-picked commit from openedx-unsupported#6706

Description

At Opencraft, we have clients that want to be able to add custom HTML templates that show up while creating course components in Studio.

Currently, there's no way to achieve this besides forking edx-platform and adding the yaml files to common/lib/xmodule/xmodule/templates/

This PR allows operators to set a custom directory where templates can be additionally loaded from.

  • Checks if settings.CUSTOM_RESOURCE_TEMPLATES_DIRECTORY exists.
  • If so, load the yaml files with the same logic as in the xmodule/templates directory.

Supporting information

Testing instructions

  • Update the setting settings.CUSTOM_RESOURCE_TEMPLATES_DIRECTORY to a valid path.
  • In that directory create an html directory.
  • Copy a template from common/lib/xmodule/xmodule/templates/html to the above directory with a different filename.
  • In the Studio, edit a Unit. Under the Text component you should see your new template list.

Deadline

"None"

This setting allows loading of Resource Templates from outside the
edx-platform codebase.

Operators will be able to add their own custom templates without needing
to fork edx-platform.

(cherry picked from commit 01f552f)

@pkulkark pkulkark left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keithgg LGTM 👍 Feel free to merge.

@keithgg
keithgg merged commit 93d8164 into opencraft-release/lilac.2-esme Apr 5, 2022
@Agrendalath
Agrendalath deleted the keith/bb_5885_esme branch May 10, 2022 18:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants