This question has been flagged
5 Replies
13788 Views

Is there anybody using the blog module and is happy with it? How do you use it?

In my case I like the outcome, but the creation of a blog post is a real hassle. Normally I use a text program to write a blog and copy and paste it into the web application. But this does not work in Odoo, or results in sometimes strange behavior. For example I can't paste text into a table. With a normal Odoo webpage I do often use the HTML editor as workaround or to fix wrong layouts. But the blog module does not allow the use of the HTML editor. So I have to retype any table word by word into my blog and broken layouts are sometimes impossible to fix.


Any suggestions are welcome to improve this situation. 

Avatar
Discard
Best Answer

Hello,

You cannot use the html editor because it is an html field on blog post model and not an ir.ui.view.

But if your really want paste your html code directly or just text, you can always add the field 'content' in the form view (of model blog post) in the backend. 


Avatar
Discard
Author

Thanks a lot Jérémy, this is very good solution

Just applied successfully your solution. Thanks; it helps While expecting Odoo to implement a fair blog app!

Best Answer

I needed to edit the content of a page of blog to add some specific html code.

I found a solution which is close to the proposal of Lucas Huber, but I found that this matter is not really related to the title of this post, so I post my solution in another post with a more appropriate title, there :

https://www.odoo.com/fr_FR/forum/aide-1/question/how-to-edit-html-content-of-a-blog-post-124590

Avatar
Discard

My trick :

In the view of blog.post, I added that code in the view just before the </sheet> tag :

<group string="Contenu">

<field name="content" placeholder="Ajoutez une description..." widget="html" modifiers="{}"/ >

</group>

The ' widget="html" ' clause make the field use the html editor instead of a simple mono or multi-line editor.

The id of the view to be modified/inherited is : website_blog.view_blog_post_form

Flag

I just tried your proposal and I got an error message saying

ValidateError

Field(s) `arch` failed against a constraint: Invalid view definition

Error details:

attributes construct error, line 9, column 70

You have a syntax problem in your xml file, may be caused at line 9 or may be not because those error message and not always very precise. If you dont see the error, my advice is to neutralize parts of your xml file up to find the wrong part. I think that my text <group>....</group> is syntaxically correct and cannot cause your error by itself.

I don't have many possibilities as I am using a SAAS database! je vais en rester là sans changement. en attendant une version native du blog plus performante!Merci

Author Best Answer

I did ad the content field to the blog.post model form view "blog.post.form" but strangely the html field does always over shoot the width of the form sheet. It is still usable but not nice. I don't have an idea why, because I often use html fields and never experierenced such behavior.

<notebook>
     <page name="content" string="Blog content">
             <field name="content" style="width: 600px"/>
     </page>
     <page name="technical" string="Technical" groups="base.group_no_one">
           <group string="Technical" groups="base.group_no_one">
                 <field name="write_uid" context="{'default_groups_ref': ['base.group_user',                 'base.group_partner_manager', 'base.group_website_designer']}"/>    
                 <field name="write_date"/>
         </group>
     </page>
 </notebook>

I did try to avoid this in adding style="width: 600px" or widget="html".

Avatar
Discard