Skip to content

Commit

Permalink
fix: v3.12.0-alpha.10 crash (add template redirects) (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar authored Jul 25, 2023
1 parent 0cbb84e commit ca1366b
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Project-specific code built into the [Core CMS] project
> **Warning**
> This repository is deprecated. Do **not** deploy these websites via this repository with [TACC/Core-CMS#v3.12.0](https://github.com/TACC/Core-CMS/releases/tag/v3.12.0) or greater. **Instead**, [migrate them to Core CMS Custom](#port-project).[^1]
[^1]: [Websites with custom templates will experience a major problem.](https://github.com/TACC/Core-CMS-Resources/pull/176#issuecomment-1603194690) Even though not all websites have such templates **and** there is a [tested solution](https://github.com/TACC/Core-CMS-Resources/pull/176#issuecomment-1603215969), website development benefits so much from migration, that every opportunity is taken to encourage it.
[^1]: Deploying websites that are still in Core-CMS-Resources **and** have [old custom templates will trigger a major problem](https://github.com/TACC/Core-CMS-Resources/pull/176#issuecomment-1603194690). The prefered solution is [migration](#port-project). If you must deploy without migration, then [upgrade the website for Core-CMS v3.12](./docs/upgrade-project.md#for-core-cms-v312).

## Table of Contents

Expand Down
1 change: 1 addition & 0 deletions a2cps-cms/templates/fullwidth.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% extends "a2cps_cms/templates/fullwidth.html" %}
1 change: 1 addition & 0 deletions a2cps-cms/templates/standard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% extends "a2cps_cms/templates/standard.html" %}
2 changes: 2 additions & 0 deletions a2cps_cms/settings_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
CMS_TEMPLATES = (
('a2cps_cms/templates/standard.html', 'Standard'),
('a2cps_cms/templates/fullwidth.html', 'Full Width'),
('a2cps-cms/templates/standard.html', 'DEPRECATED Standard'),
('a2cps-cms/templates/fullwidth.html', 'DEPRECATED Full Width'),
('guide.html', 'Guide'),
('guides/getting_started.html', 'Guide: Getting Started'),
('guides/data_transfer.html', 'Guide: Data Transfer'),
Expand Down
35 changes: 35 additions & 0 deletions docs/upgrade-project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Upgrade Project

## for Core-CMS v3.12

### Redirect Deprecated Templates

**If** the custom project directory:

- has `templates/standard.html` or
- has `templates/fullwidth.html` or
- has `templates/home.html`

Then:

1. Copy the templates to become deprecated templates:
- from `custom_project_dir/templates`
- to `custom-project-dir/templates`

> **Warning**
> The name `custom_project_dir` **must** match the old name as it was, including dashes.
2. Edit the deprecated templates to extend the new templates e.g.

```django
{% extends "custom_project_dir/templates/standard.html" %}
```
3. Update `settings_custom.py` to support deprecated templates:
```diff
('custom_project_dir/templates/standard.html', 'Standard'),
('custom_project_dir/templates/fullwidth.html', 'Full Width'),
+ ('custom-project-dir/templates/standard.html', 'DEPRECATED Standard'),
+ ('custom-project-dir/templates/fullwidth.html', 'DEPRECATED Full Width'),
```
1 change: 1 addition & 0 deletions frontera-cms/templates/fullwidth.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% extends "frontera_cms/templates/fullwidth.html" %}
1 change: 1 addition & 0 deletions frontera-cms/templates/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% extends "frontera_cms/templates/home.html" %}
1 change: 1 addition & 0 deletions frontera-cms/templates/standard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% extends "frontera_cms/templates/standard.html" %}
3 changes: 3 additions & 0 deletions frontera_cms/settings_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
('frontera_cms/templates/standard.html', 'Standard'),
('frontera_cms/templates/fullwidth.html', 'Full Width'),
('frontera_cms/templates/home.html', 'Homepage'),
('frontera-cms/templates/standard.html', 'DEPRECATED Standard'),
('frontera-cms/templates/fullwidth.html', 'DEPRECATED Full Width'),
('frontera-cms/templates/home.html', 'DEPRECATED Homepage'),

('guide.html', 'Guide'),
('guides/getting_started.html', 'Guide: Getting Started'),
Expand Down

0 comments on commit ca1366b

Please sign in to comment.