Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement way to include italicized court cases in page titles #575

Closed
Tracked by #60 ...
noahmanger opened this issue Nov 2, 2016 · 8 comments
Closed
Tracked by #60 ...

Implement way to include italicized court cases in page titles #575

noahmanger opened this issue Nov 2, 2016 · 8 comments

Comments

@noahmanger
Copy link

noahmanger commented Nov 2, 2016

The standard way to write something like Citizens United v. FEC is to italicize it. When these show up in press release titles, however, we can't currently italicize them. The task here is to update the title field to allow for this sort of formatting.

My proposed solution is to modify the title field of the press_release_page models in Wagtail to allow rich text, but maybe there's a better way?

@ccostino
Copy link
Contributor

@noahmanger: The title field you're referring to, does it always only contain the title and therefore should always be displayed italicized when displayed? Or are we dealing with a field that includes more than just the title of a case itself?

@noahmanger
Copy link
Author

The latter. So we need to be able to display a title like:

Something something something Supreme Court rules in Citizens United v. FEC

I don't know that it's possible (or desirable) to make the built-in title field a rich-text field. So one idea I had was to have an optional field that's like rich_title and if that field is present, use that value where the title would go.

@ccostino
Copy link
Contributor

Ah, I see what you mean. Wagtail does provide a RichTextField field type, but I'm not sure that's the way to go for overriding the existing title field type.

Another thought that comes to mind is that there's no easy way to discern the court case in a string of text either, right? For example, let's say the display did support formatting as is right now. How would the court case get italicized in this case? Someone going in and adding the formatting where appropriate?

@noahmanger
Copy link
Author

Yeah, I'm afraid there's no way to automatically detect them, given that they have such irregular names.

@ccostino
Copy link
Contributor

That's what I was afraid of and given that notion I'm not sure even a regular expression is worth building to try and parse it out. That'd only be useful if there was some pattern to follow that would match a majority of the time.

Given that, I think you're right in just changing the field to be a rich text field. That will allow someone to modify the text to be formatted properly and we'd then use that for the display. Alternatively you could have a separate field for this like you mentioned, but I'd only go down that route if we needed to preserve the original title as is (and in that case, just copy the entire title into the rich text field and format what you need to, otherwise you run into the problem of figuring out which part of the title to replace with the formatted version).

@noahmanger
Copy link
Author

The reason I suggested an additional field is that I'm not sure if Wagtail lets you override the page title field itself. That might need to be a plain string. Though do you see a way to do this?

@ccostino
Copy link
Contributor

ccostino commented Dec 1, 2016

Ah right, good point on that - I'd have to look to see!

@noahmanger
Copy link
Author

Ok! I think I figured out a decent solution in #621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants