Rich text page links use admin display title instead of regular title
See original GitHub issueIssue Summary
When inserting a link to a page from the rich text editor, the anchor text that is pre-populated (if you haven’t selected some text to anchor) is generated from the admin page title (Page.get_admin_display_title
). This is not expected behaviour, because this is not the public page title that is visible on the published page.
Steps to Reproduce
- Override
Page.get_admin_display_title
on a page model - for example to include some additional context about the page such as when it was created. This should only be visible when viewing pages in the admin. - In a rich text field, add a link to this page. The auto-populated anchor text will use the admin display title instead of just the
title
field value.
Technical details
- Python version: 3.6
- Django version: 2.0
- Wagtail version: master
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Using the rich text editor for content
In your Shopify admin, click the Show HTML button on the rich text editor for the content ... Enter a short description of...
Read more >Configure the Rich Text Editor | Adobe Experience Manager
Learn to configure the AEM Rich Text Editor. ... To know how to use RTE features for authoring, see Use Rich Text Editor...
Read more >lightning-formatted-rich-text - documentation
Displays rich text that's formatted with allowed tags and attributes. Other tags and attributes are removed and only their text content is displayed....
Read more >Editing Content in the Rich Text Editor
Editing Content in the Rich Text Editor. Click “Show Editor”, or double click within the rich text editor window to open the “RICH...
Read more >Rich text internals
At first glance, Wagtail's rich text capabilities appear to give editors direct ... pages will generally reserve the <h1> element for the page...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@chosak Sorry, I should have been more specific there… I think the use of the draft title as the default link text for generated links in rich text is an oversight. Displaying the draft title to editors within listings etc is appropriate (and so no changes to
get_admin_display_title
are necessary), but that’s where it should end - the draft title shouldn’t find its way into other pages’ content.(This does mean that in this one specific case, where a title has been edited in draft, there’ll be a slightly jarring effect where the editor sees one title in the listing, clicks on it, and ends up with a different title as the link text. I think that behaviour is justified, though.)
Fixed in #5491