Skip to content

(redo) feat: added new setting CUSTOM_RESOURCE_TEMPLATES_DIRECTORY - #31117

Closed
keithgg wants to merge 1 commit into
openedx:open-release/maple.masterfrom
open-craft:keith/bb_5885_new_maple_backport
Closed

(redo) feat: added new setting CUSTOM_RESOURCE_TEMPLATES_DIRECTORY#31117
keithgg wants to merge 1 commit into
openedx:open-release/maple.masterfrom
open-craft:keith/bb_5885_new_maple_backport

Conversation

@keithgg

@keithgg keithgg commented Oct 6, 2022

Copy link
Copy Markdown
Contributor

This PR is a redo of #30759 which itself is a backport of #30108 to maple.master. Re-using the description below.

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 (on the Sandbox I've added many).

Deadline

"None"

Other

Settings

EDXAPP_CUSTOM_RESOURCE_TEMPLATES_DIRECTORY: /edx/var/edx-themes/edx-themes/resource-templates
edx_platform_commit: keith/bb_5885_maple_backport
edx_platform_repository_url: https://github.com/open-craft/edx-platform.git
configuration_source_repo_url: https://github.com/open-craft/configuration.git
configuration_version: master

@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @keithgg! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Oct 6, 2022
This setting allows loading of Resource Templates from outside the
edx-platform codebase.

Operators will be able to add their own custom resource templates
without needing to fork the codebase.

(cherry picked from commit ed81774)
@keithgg
keithgg force-pushed the keith/bb_5885_new_maple_backport branch from b96da20 to e03eea7 Compare October 6, 2022 09:51
@keithgg keithgg closed this Oct 6, 2022
@openedx-webhooks

Copy link
Copy Markdown

@keithgg Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants