-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make custom themes work on microsites. #9282
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,10 @@ | |
{% block headextra %}{% endblock %} | ||
{% render_block "css" %} | ||
|
||
{% if THEME_ENABLED %} | ||
{% include "theme-head-extra.html"|microsite_template_path %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like an awkward usage pattern. Django's template lookup system is designed to handle the sort of directory lookup that the Also, you're doing a conditional |
||
{% endif %} | ||
|
||
{% microsite_css_overrides_file %} | ||
|
||
<meta name="path_prefix" content="{{EDX_ROOT_URL}}"> | ||
|
@@ -30,22 +34,24 @@ | |
<div class="window-wrap" dir="${static.dir_rtl()}"> | ||
<a class="nav-skip" href="{% block nav_skip %}#content{% endblock %}">{% trans "Skip to main content" %}</a> | ||
{% with course=request.course %} | ||
{% if IS_EDX_DOMAIN %} | ||
{% if THEME_ENABLED %} | ||
{% include "theme-header.html"|microsite_template_path %} | ||
{% elif IS_EDX_DOMAIN and not IS_REQUEST_IN_MICROSITE %} | ||
{% include "navigation-edx.html" %} | ||
{% else %} | ||
{% include "navigation.html" %} | ||
{% include "navigation.html"|microsite_template_path %} | ||
{% endif %} | ||
{% endwith %} | ||
<div class="content-wrapper" id="content"> | ||
{% block body %}{% endblock %} | ||
{% block bodyextra %}{% endblock %} | ||
</div> | ||
{% if IS_REQUEST_IN_MICROSITE %} | ||
{# For now we don't support overriden Django templates in microsites. Leave footer blank for now which is better than saying Edx.#} | ||
{% elif IS_EDX_DOMAIN %} | ||
{% if THEME_ENABLED %} | ||
{% include "theme-footer.html"|microsite_template_path %} | ||
{% elif IS_EDX_DOMAIN and not IS_REQUEST_IN_MICROSITE %} | ||
{% include "footer-edx-v3.html" %} | ||
{% else %} | ||
{% include "footer.html" %} | ||
{% include "footer.html"|microsite_template_path %} | ||
{% endif %} | ||
|
||
</div> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #8271, we're planning to change the names of these files. You can just use
header-extra.html
, andgoogle_analytics.html
in your theme directory, and the template system should include them. As a result, you can roll the contents oftheme-head-extra.html
intoheader-extra.html
.