feat: pass context to page extensions
Pass the context to page extensions to allow them to make decisions based on the context. For example, an extension to load the course specific scripts. This is currently not possible because the course details are not availale to the page extensions. Made this possible by passing the context to page extensions.
This commit is contained in:
@@ -24,6 +24,11 @@ class PageExtension:
|
||||
`render_footer()` methods to inject whatever styles/scripts into
|
||||
the webpage.
|
||||
"""
|
||||
def __init__(self):
|
||||
self.context = frappe._dict()
|
||||
|
||||
def set_context(self, context):
|
||||
self.context = context
|
||||
|
||||
def render_header(self):
|
||||
"""Returns the HTML snippet to be included in the head section
|
||||
|
||||
Reference in New Issue
Block a user