Skip to content

fix: intuitive template paths in custom CMS apps - #983

Draft
wesleyboar wants to merge 28 commits into
mainfrom
fix/allow-custom-cms-apps-to-load-templates-with-short-paths
Draft

fix: intuitive template paths in custom CMS apps#983
wesleyboar wants to merge 28 commits into
mainfrom
fix/allow-custom-cms-apps-to-load-templates-with-short-paths

Conversation

@wesleyboar

@wesleyboar wesleyboar commented Sep 6, 2025

Copy link
Copy Markdown
Member

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

wesleyboar commented Sep 8, 2025

Copy link
Copy Markdown
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
@wesleyboar
wesleyboar changed the base branch from main to release/v4.36.X July 27, 2026 17:15
@wesleyboar
wesleyboar changed the base branch from release/v4.36.X to main July 27, 2026 17:15
@wesleyboar
wesleyboar marked this pull request as ready for review July 27, 2026 21:59
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@wesleyboar
wesleyboar marked this pull request as draft July 27, 2026 21:59
wesleyboar added a commit that referenced this pull request Jul 27, 2026
## Overview

Recreates #728, whose commit is no longer reachable from `main`'s
current history. Adds a `list_plugin_pages` management command to look
up which page uses a given plugin instance.

## Related

- recreates #728
- required by #983 (once merged, rebasing/merging `main` into #983
should drop the portion of its diff that duplicates this)

## Changes

- **added** `list_plugin_pages` command to find what page uses a given
plugin instance
- **added** README section documenting the command

## Testing

1. Open a local or staging server.
2. Find a plugin instance ID (e.g. via CMS admin or browsing the page's
plugin tree).
3. Run `python manage.py list_plugin_pages THAT_ID`.
4. Verify output reports the page it's used on.

## UI

Skipped. Non-UI change (management command).

## Notes

Proof of success is #728 which is in `release/v4.36.X`.
@wesleyboar wesleyboar added the alternative Alternative solution(s) exist(s) label Jul 27, 2026
@wesleyboar wesleyboar added the paused Started but not actively in progress label Jul 27, 2026
@wesleyboar wesleyboar changed the title fix: allow intuitive template paths in custom CMS apps fix: intuitive template paths in custom CMS apps Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alternative Alternative solution(s) exist(s) enhancement Improvements or additions to existing features paused Started but not actively in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant