Skip to content

Commit ca1366b

Browse files
authored
fix: v3.12.0-alpha.10 crash (add template redirects) (#186)
1 parent 0cbb84e commit ca1366b

File tree

9 files changed

+46
-1
lines changed

9 files changed

+46
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Project-specific code built into the [Core CMS] project
88
> **Warning**
99
> 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]
1010
11-
[^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.
11+
[^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).
1212

1313
## Table of Contents
1414

a2cps-cms/templates/fullwidth.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "a2cps_cms/templates/fullwidth.html" %}

a2cps-cms/templates/standard.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "a2cps_cms/templates/standard.html" %}

a2cps_cms/settings_custom.py

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
CMS_TEMPLATES = (
1111
('a2cps_cms/templates/standard.html', 'Standard'),
1212
('a2cps_cms/templates/fullwidth.html', 'Full Width'),
13+
('a2cps-cms/templates/standard.html', 'DEPRECATED Standard'),
14+
('a2cps-cms/templates/fullwidth.html', 'DEPRECATED Full Width'),
1315
('guide.html', 'Guide'),
1416
('guides/getting_started.html', 'Guide: Getting Started'),
1517
('guides/data_transfer.html', 'Guide: Data Transfer'),

docs/upgrade-project.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Upgrade Project
2+
3+
## for Core-CMS v3.12
4+
5+
### Redirect Deprecated Templates
6+
7+
**If** the custom project directory:
8+
9+
- has `templates/standard.html` or
10+
- has `templates/fullwidth.html` or
11+
- has `templates/home.html`
12+
13+
Then:
14+
15+
1. Copy the templates to become deprecated templates:
16+
- from `custom_project_dir/templates`
17+
- to `custom-project-dir/templates`
18+
19+
> **Warning**
20+
> The name `custom_project_dir` **must** match the old name as it was, including dashes.
21+
22+
2. Edit the deprecated templates to extend the new templates e.g.
23+
24+
```django
25+
{% extends "custom_project_dir/templates/standard.html" %}
26+
```
27+
28+
3. Update `settings_custom.py` to support deprecated templates:
29+
30+
```diff
31+
('custom_project_dir/templates/standard.html', 'Standard'),
32+
('custom_project_dir/templates/fullwidth.html', 'Full Width'),
33+
+ ('custom-project-dir/templates/standard.html', 'DEPRECATED Standard'),
34+
+ ('custom-project-dir/templates/fullwidth.html', 'DEPRECATED Full Width'),
35+
```

frontera-cms/templates/fullwidth.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "frontera_cms/templates/fullwidth.html" %}

frontera-cms/templates/home.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "frontera_cms/templates/home.html" %}

frontera-cms/templates/standard.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "frontera_cms/templates/standard.html" %}

frontera_cms/settings_custom.py

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
('frontera_cms/templates/standard.html', 'Standard'),
1414
('frontera_cms/templates/fullwidth.html', 'Full Width'),
1515
('frontera_cms/templates/home.html', 'Homepage'),
16+
('frontera-cms/templates/standard.html', 'DEPRECATED Standard'),
17+
('frontera-cms/templates/fullwidth.html', 'DEPRECATED Full Width'),
18+
('frontera-cms/templates/home.html', 'DEPRECATED Homepage'),
1619

1720
('guide.html', 'Guide'),
1821
('guides/getting_started.html', 'Guide: Getting Started'),

0 commit comments

Comments
 (0)