Skip to content

Conversation

@wesleyboar
Copy link
Member

@wesleyboar wesleyboar commented Sep 6, 2025

Overview / Changes

Install taccsite_custom/*/ apps before taccsite_cms to allow those custom apps to load templates from themselves before Core-CMS.

Use Cases:

  • {% extend … %}
  • CMS_TEMPLATES

This should fix long-standing non-intuitive template inheritance.

Warning

This may work, but then how to override a Core-CMS template? Currently, fullwidth.html extends ./base.html which extends base.html. In this branch, ./base.html extending base.html causes recursion error.

Tip

To prevent recursion error:

  1. Rename Texascale's base template:
    - from …/texascale_cms/templates/base.html
    - to …/texascale_cms/templates/base_texascale.html
  2. Update Texascale's fullwidth template to:
    - extend ./base_texascale.html

Untested, but makes sense.

Related

Testing

Texascale

  1. Replace {% extends "./fullwidth.html" %} with {% extends "fullwidth.html" %}.
  2. Verify page still loads same styles.
  3. To CMS_TEMPLATES, add ('article.html', 'Article NEW').
  4. Create/Open a page.
  5. Switch page template between "Article" and "Article NEW".
  6. Page styles and markup should not change.

APCD

  1. Replace {% extends "apcd_cms/templates/standard.html" %} with {% extends "standard.html" %}.
  2. Verify extension still occurs.
    Page still loads React app and apcd_cms/css/site.cms.css still loads.

UI

* 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.
@wesleyboar wesleyboar marked this pull request as draft September 6, 2025 01:04
@wesleyboar wesleyboar changed the title fix: allow short template paths in custom CMS apps fix: allow intuitive template paths in custom CMS apps Sep 6, 2025
@wesleyboar
Copy link
Member Author

Tip

To prevent recursion error:

  1. Rename Texascale's base template:
    - from …/texascale_cms/templates/base.html
    - to …/texascale_cms/templates/base_texascale.html
  2. Update Texascale's fullwidth template to:
    - extend ./base_texascale.html

Untested, but makes sense.

@wesleyboar wesleyboar added the enhancement Improvements or additions to existing features label Sep 8, 2025
@wesleyboar wesleyboar changed the base branch from release/v4.36.X to main January 30, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvements or additions to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants