Dear all,
We are using the Blog on odoo 14 community to publish article. How can we make sure the author and time of publication are always shown at the bottom of the article?
Best Regards
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Dear all,
We are using the Blog on odoo 14 community to publish article. How can we make sure the author and time of publication are always shown at the bottom of the article?
Best Regards
Please provide some details:
- are you able to modificate xml code yourself? (some developers skills?)
- be sure that on the front page you have turn on showin Author (and Sidebar)
->you must be logged in as editor/admin -> choose Customize from top -> select Author and Sidebar
- be more precise... you want to show the author block and date below instead of the sidebar?
- Enterprise version or Community of Odoo?
EDITED =====================
Thanks! Below the full answer for you.
Hello, ok, now I can help you...
A. If you like only to modify the template of the blogpost from Odoo backend.
1. Log in into backend
2. Activate developer mode (Bottom of the Settings page)
3. Go to Settings -> Technical -> find "Views" -> enter
4. search for "blog_post_content" -> open it
5. hit Edit -> modify the code like this:
paste below html block after the last </div> and before </t>
<div class="mt-3 d-flex justify-content-end">
<t t-call="website_blog.post_author">
<t t-set="additionnal_classes" t-value="'h5 d-flex align-items-center'"/>
</t>
</div>
So your full code looks like this:
<?xml version="1.0"?>
<t name="Blog post content" t-name="website_blog.blog_post_content">
<t t-if="opt_blog_post_breadcrumb and not opt_blog_post_regular_cover" t-call="website_blog.post_breadcrumbs">
<t t-set="additionnal_classes" t-value="'mb-3 bg-transparent'"/>
</t>
<div t-field="blog_post.content" data-editor-message="WRITE HERE OR DRAG BUILDING BLOCKS" t-attf-class="o_wblog_post_content_field #{'js_tweet' if opt_blog_post_select_to_tweet else ''} #{'js_comment' if opt_blog_post_select_to_comment else ''} #{'o_wblog_read_text' if opt_blog_post_readable else ''}"/>
<div t-if="len(blogs) > 1 or len(blog_post.tag_ids) > 0" class="css_editable_mode_hidden text-muted">
<div t-if="len(blogs) > 1">in <a t-attf-href="#{blog_url(blog=blog_post.blog_id)}"><b t-field="blog.name"/></a></div>
<div t-if="len(blog_post.tag_ids) > 0">#
<t t-foreach="blog_post.tag_ids" t-as="one_tag">
<a class="badge border mr-1 post_link" t-attf-href="#{blog_url(tag=slug(one_tag), date_begin=False, date_end=False)}" t-esc="one_tag.name"/>
</t>
</div>
</div>
<div class="mt-3 d-flex justify-content-end">
<t t-call="website_blog.post_author">
<t t-set="additionnal_classes" t-value="'h5 d-flex align-items-center'"/>
</t>
</div>
</t>
6. save it, and check now your post
7. Now on the front you can turn on "Author" showing in the sidebar via Customize menu
8 TIP: if you want to have your author on the left side, please change the class "justify-content-end" to "justify-content-start" for the custom block you pasted
B. If you have skills to create new module way
----------------------------------------------
1. create custom module
2. in template.xml wich you load from your manifest you have to put this code:
<template id="website_blog_post_author_custom" inherit_id="website_blog.blog_post_content" name="Blog post author name custom">
<xpath expr="//t[@name='Blog post content']" position="inside">
<div class="mt-3 d-flex justify-content-end">
<t t-call="website_blog.post_author">
<t t-set="additionnal_classes" t-value="'h5 d-flex align-items-center'"/>
</t>
</div>
</xpath>
</template>
3. install this module
4. TIP: if you want to have your author on the left side, please change the class "justify-content-end" to "justify-content-start" for the custom block you pasted
Hope this will help you and save you lot of time.
Please, vote + for my answer and i you find it Best, mark it "Best Answer", I will appreciate it.
Thanks, Krys
Answers below:
1) ODOO 14 community edition
2) author and sidebar are on
3) as said, we would like it to be at the bottom of the page
4) I am able to modify the XML code
Best,
Dear Krys, I wanted to give a positive vote to your answer, but the system says I do not have enough karma, I am really sorry.
I have updated my answer for you... if this will help, please mark it as best answer and hit positive vote with arrow up. Thank you :)
Dear Krys,
I am not allowed to comment or upvote your answer because I do not have sufficient karma! :-(
Best,
--
I have updated my answer for you... if this will help, please mark it as best answer and hit positive vote with arrow up. Thank you :)
Ok, no problem, can you mark it as best answer? Of course if it is really the best answer :)
I have voted to your question - now you should have some carma :)
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Jun 22
|
2673 | ||
|
2
Feb 16
|
3592 | ||
|
1
Jul 24
|
6887 | ||
|
3
Jun 24
|
1918 | ||
|
0
Feb 24
|
1325 |