feat: WP-197 conditional PORTAL_STYLES #880
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Update
PORTAL_STYLES
setting to:page_id
only load on Django CMS page with matching "Id".template_name
only load on Django CMS page with matching "Template".Why?
Allows a custom CMS on
taccwma/core-cms
Docker image to have page-specific stylesheets (without using a CMS Snippet to load the stylesheet).What's wrong with a Snippet?
Don't complicate the CMS. Just load the Snippet earlier.
Good idea. Less CMS code. All snippets now use "Content" or "Footer" placeholder. I would just add a custom placeholder e.g. "Head". My concerns:
Status
data-page-template
onhtml
!?Use
[data-page-template]
and[data-page-id]
to scope styles.Related
Changes
PORTAL_STYLES
Testing
Edit
settings_local.py
orsettings_custom.py
:Create/Edit pages to test these stylesheets.
page_id
, set "Id".template_name
, set "Template".Verify
<!-- Custom Site Assets: Styles. -->
of every page.UI