fix: allow intuitive template paths in custom CMS apps#983
Draft
wesleyboar wants to merge 24 commits intomainfrom
Draft
fix: allow intuitive template paths in custom CMS apps#983wesleyboar wants to merge 24 commits intomainfrom
wesleyboar wants to merge 24 commits intomainfrom
Conversation
* fix: inaccurate text picture template name * fix: show value if old template is in use
* feat: support core-styles u-image-zoom * feat: support core-styles u-image-zoom via script * Revert "feat: support core-styles u-image-zoom via script" This reverts commit 2a15a75. * feat: support zoom_effect + no_link_to_image * refactor: only load css once from multiple tries * refactor: extract link & figure start to templates * refactor: rebuild zoom templates to strip classes * feat: template tag `strip_class_attribute` * fix: strip_class_attribute munges data-class test * fix: template name/path typo * fix: all picture template bugs i think * docs: add help_text to Picture template field * feat: overwrite bs4 picture plugin validation * fix: strip_class_attr… regex munges `data-class` * test: highlight unsupported figure image zoom * fix: u-image-zoom-- class not added * fix: sometimes span missing & class in wrong spot * fix: core-styles zoom bug * enhance: clearer debuging ui * refactor: template logic → custom view context * Revert "refactor: template logic → custom view context" This reverts commit a123568.
* feat: support core-styles u-image-zoom * feat: support core-styles u-image-zoom via script * Revert "feat: support core-styles u-image-zoom via script" This reverts commit 2a15a75. * feat: support zoom_effect + no_link_to_image * refactor: only load css once from multiple tries * refactor: extract link & figure start to templates * refactor: rebuild zoom templates to strip classes * feat: template tag `strip_class_attribute` * fix: strip_class_attribute munges data-class test * fix: template name/path typo * fix: all picture template bugs i think * docs: add help_text to Picture template field * feat: overwrite bs4 picture plugin validation * fix: strip_class_attr… regex munges `data-class` * test: highlight unsupported figure image zoom * fix: u-image-zoom-- class not added * fix: sometimes span missing & class in wrong spot * fix: core-styles zoom bug * enhance: clearer debuging ui * refactor: template logic → custom view context * Revert "refactor: template logic → custom view context" This reverts commit a123568. * refactor: template logic → custom view context * fix: bad/old path to zoom asset * refactor: move css snippet to stylehseet * refactor: rename test stylesheet * fix: test stylesheet too specific * fix: a lot, and simplify * refactor!: revert template names * fix: final bugs * chore: remove excess new line * refactor: simplify templates and update comments
* deps: core-styles v2.46.1 * refactor: u-image-zoom via core-styles
* fix: space under span.u-image-zoom img * deps: core-styles v2.46.2
* feat: snippet to redirect external article * fix: load Core-CMS script not tup-ui script
* feat: command, find plugins within TextPlugin⚠️ ⚠️ INCOMPLETE. DOES NOT WORK. SEE `get_parent_text_plugins`. * feat: command, find pages with given plugin⚠️ ⚠️ UNTESTED & UNPOLISHED AS DJANGO COMMAND. * fix: find_pages_with_plugins tested on Texascale prod ad-hoc by copy/pasting and asking AI for help * chore: delete unused unfinished plugin * doc: find_pages_with_plugins * refactor: rename command
Moving `taccsite_custom/*/` before `taccsite_cms` allows those custom apps to load CMS_TEMPLATES from themself before looking in Core-CMS. This should fix long-standing unintuitive template inheritance.
Member
Author
|
Tip To prevent recursion error:
Untested, but makes sense. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 / Changes
Install
taccsite_custom/*/apps beforetaccsite_cmsto allow those custom apps to load templates from themselves before Core-CMS.Use Cases:
{% extend … %}CMS_TEMPLATESThis should fix long-standing non-intuitive template inheritance.
Warning
This may work, but then how to override a Core-CMS template? Currently,
fullwidth.htmlextends./base.htmlwhich extendsbase.html. In this branch,./base.htmlextendingbase.htmlcauses recursion error.Tip
To prevent recursion error:
basetemplate:- from
…/texascale_cms/templates/base.html- to
…/texascale_cms/templates/base_texascale.htmlfullwidthtemplate to:- extend
./base_texascale.htmlUntested, but makes sense.
Related
Testing
Texascale
{% extends "./fullwidth.html" %}with{% extends "fullwidth.html" %}.CMS_TEMPLATES, add('article.html', 'Article NEW').APCD
{% extends "apcd_cms/templates/standard.html" %}with{% extends "standard.html" %}.Page still loads React app and
apcd_cms/css/site.cms.cssstill loads.UI
…