Skip to content

Commit 1320c6a

Browse files
author
Cameron Lamb
committed
Merge branch 'SociologicalReview-text-features-setting'
2 parents 824ce7e + eaf0338 commit 1320c6a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ Add footnotes functionality to your Wagtail project.
4949
./manage.py migrate
5050
```
5151
52+
## Settings
53+
54+
- `WAGTAIL_FOOTNOTES_TEXT_FEATURES`
55+
- Default: `["bold", "italic", "link"]`
56+
- Use this to update a list of Rich Text features allowed in the footnote text.
57+
5258
## Common issues
5359
- I click on the `Fn` button in the editor and it stops working
5460
- This is likely because the URL in the JS does not match the URL of the footnotes view. Check the URL in `wagtail_footnotes/static/footnotes/js/footnotes.js` matches the URL you set.

wagtail_footnotes/models.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from django.conf import settings
12
from django.db import models
23
from modelcluster.fields import ParentalKey
34
from wagtail.admin.edit_handlers import FieldPanel, InlinePanel
@@ -21,6 +22,12 @@ class Footnote(models.Model):
2122
help_text="The ID of the footnote is shown in the rich text editor for "
2223
"reference.",
2324
)
24-
text = RichTextField(features=["bold", "italic", "link"])
25+
text = RichTextField(
26+
features=getattr(
27+
settings,
28+
'WAGTAIL_FOOTNOTES_TEXT_FEATURES',
29+
["bold", "italic", "link"]
30+
)
31+
)
2532

2633
panels = [FieldPanel("text"), FieldPanel("uuid", widget=ReadonlyUUIDInput)]

0 commit comments

Comments
 (0)