From 0c4da76f490315e1c6b1b7086dca3ab97544e4e3 Mon Sep 17 00:00:00 2001 From: sarina Date: Fri, 6 Dec 2024 14:04:57 -0500 Subject: [PATCH] Use raw HTML rather than collapse toggles --- .../sumac/customizing_header.rst | 201 +++++++++--------- 1 file changed, 106 insertions(+), 95 deletions(-) diff --git a/source/community/release_notes/sumac/customizing_header.rst b/source/community/release_notes/sumac/customizing_header.rst index 0b3d88f7..c14246ce 100644 --- a/source/community/release_notes/sumac/customizing_header.rst +++ b/source/community/release_notes/sumac/customizing_header.rst @@ -36,28 +36,33 @@ With frontend plugin slots, you can now hide the "Help" button: .. image:: /_images/release_notes/sumac/sumac-header-easy-after.png -For site operators, here is a sample of the ``env.config.jsx`` file used to hide -the the content: +.. raw:: html -.. toggle:: +
+ For site operators, here is a sample of the env.config.jsx file used to hide +the the content. - .. code-block:: javascript +.. code-block:: jsx - import { PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework'; + import { PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework'; - const config = { - pluginSlots: { - learning_help_slot: { - plugins: [ - { - op: PLUGIN_OPERATIONS.Hide, - }, - ] + const config = { + pluginSlots: { + learning_help_slot: { + plugins: [ + { + op: PLUGIN_OPERATIONS.Hide, }, - }, - } + ] + }, + }, + } + + export default config; - export default config; +.. raw:: html + +
Medium-effort example: Replacing "Course Info" with a custom component ********************************************************************** @@ -72,89 +77,95 @@ this case, an icon of a book) in place of the course info component: .. image:: /_images/release_notes/sumac/sumac-header-medium-after.png -For site operators, here is a sample of the ``env.config.jsx`` file used to -render the custom component: - -.. toggle:: +.. raw:: html + +
+ For site operators, here is a sample of the env.config.jsx file used to hide +the the content. + +.. code-block:: jsx + + import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework'; + import {Helmet} from "react-helmet"; + + const config = { + pluginSlots: { + course_info_slot: { + keepDefault: false, + plugins: [ + { + op: PLUGIN_OPERATIONS.Insert, + widget: { + id: 'custom_course_info_component', + type: DIRECT_PLUGIN, + RenderWidget: ({ courseTitle }) => ( + <> + + + +
+
{courseTitle}
+
+ + ), + }, + }, + ] + } + }, + } - .. code-block:: + export default config; - import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework'; - import {Helmet} from "react-helmet"; +.. raw:: html - const config = { - pluginSlots: { - course_info_slot: { - keepDefault: false, - plugins: [ - { - op: PLUGIN_OPERATIONS.Insert, - widget: { - id: 'custom_course_info_component', - type: DIRECT_PLUGIN, - RenderWidget: ({ courseTitle }) => ( - <> - - - -
-
{courseTitle}
-
- - ), - }, - }, - ] - } - }, - } +
- export default config; Advanced example: Replacing the entire header *********************************************