开发者

Feincms mixing content types

开发者 https://www.devze.com 2023-01-31 09:15 出处:网络
I have a question and i want to know if i can mix 2 existing contenTypes together into one custom contenType. I need my own content type with contenType RichTextContent and ImageCont开发者_如何学Cent

I have a question and i want to know if i can mix 2 existing contenTypes together into one custom contenType. I need my own content type with contenType RichTextContent and ImageCont开发者_如何学Cent so that i can use a special template to show an image right and text left.

Is this possible ?.


Yes, it's definitely possible. I've written my own custom contenttypes for similar reasons. You should review the code for the RichTextContent model in <Python egg dir>/feincms/content/richtext/models.py

You'll want to implement your own model class, and override the render() method to use django.template.loader.render_to_string() to load the template you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消