jensens
(Jens W. Klein)
1
In a behavior I need (a couple of times) a simple text field (like the description field):
- where the output is transformed to HTML
- in a way known as "intelligenttext" (keep linebreaks as
<br>
)
- so that I do not need to bloat my view logic (yes, with that it's easy)
- make URLs to links
How would you achieve this? My current solutions are working, but are really code-bloating. And I have plenty such fields in my forms.
espenmn
(Espen)
2
Can you use a custom widget and then just transform
for the output widget ?
jensens
(Jens W. Klein)
3
Well, figure out that the following should do what I want:
weiterbildende_kurse = RichText(
title=u'Weiterbildende Kurse',
required=False,
default_mime_type='text/x-web-intelligent',
allowed_mime_types=('text/x-web-intelligent', ),
output_mime_type='text/x-html-safe',
)
The problem: It still loads TinyMCE, even if the text/html
is not in the input. This is complete nonsense, shall I consider this a bug?
espenmn
(Espen)
4
Is there any point in using RichText ?
What about using schema.Text ?
jensens
(Jens W. Klein)
5
RichText has the nice transform thing, Text doesn't have.