Using Rich Text Fields in Mezzanine

607 views
Skip to first unread message

Karthik Kannan

unread,
Jan 2, 2014, 7:01:21 PM1/2/14
to mezzani...@googlegroups.com
Hello, 

I'm trying to use a rich text field for one of the text areas in my mezzanine project. Can anyone point to some examples/documentation related to rich text fields? Trying to find examples of its usage but in vain. 

Thank you for your help.

Karthik.

Danny

unread,
Jan 2, 2014, 7:02:32 PM1/2/14
to mezzani...@googlegroups.com
Is this what you are looking for?
https://code.djangoproject.com/wiki/RichTextField

HTH. HAND.
Seeya. Danny.


--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--

Stephen McDonald

unread,
Jan 2, 2014, 7:25:07 PM1/2/14
to mezzani...@googlegroups.com
If you'd like a single content field on your model, subclass mezzanine.core.models.RichText, eg:


If you'd like more control, and want to specify one or more RichText fields yourself, just use mezzanine.core.fields.RichTextField, eg:



--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Stephen McDonald
http://jupo.org

Rafael Reuber

unread,
May 6, 2014, 11:04:03 PM5/6/14
to mezzani...@googlegroups.com, st...@jupo.org
It's possible tu use a RitchTextField on a django.db.models.Model or just on mezzanine Page object?

Stephen McDonald

unread,
May 7, 2014, 2:46:37 AM5/7/14
to Rafael Reuber, mezzani...@googlegroups.com
Should be possible - blog posts use it, and they're not related to pages.

What have you tried?

Rafael Reuber

unread,
May 7, 2014, 9:49:07 AM5/7/14
to mezzani...@googlegroups.com, Rafael Reuber, st...@jupo.org
Actually I've used on my model But when my RitchTextField attribute is used on a template it render the raw html value.

For example: If the user write a texte like  "This is the project one" on django admin.
On my custom template it shows "This is the <strong>project</strong> one"



This is my template:

{% extends "base.html" %}
{% load i18n %}

{% block meta_title %}{% trans "Home" %}{% endblock %}
{% block title %}{% trans "Home" %}{% endblock %}

{% load pages_tags %}

{% block main %}

<div class="page-header">
  <h3>{{project.title}}</h3>
</div>

{{project.description}}

{% endblock %}

Stephen McDonald

unread,
May 7, 2014, 6:30:32 PM5/7/14
to mezzani...@googlegroups.com, Rafael Reuber
Pretty standard Django stuff:


Suggest skimming all the Django and Mezzanine documentation at least once, you'll be much better off for it.


For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages