Skip to Content
Menu
This question has been flagged
2 Replies
4321 Views

In blog edit 

<data name="Our Blogs" priority="6">
  <xpath expr="//div[@id='blog_right_column']" position="inside">
    <section class="mt32 mb32">
      <h4>Our Blog</h4>
      <ul class="nav nav-pills nav-stacked">
        <t t-foreach="blogs" t-as="nav_blog">
          <li t-att-class="nav_blog.id == blog.id and 'active' or ''">
            <a t-attf-href="/blog/#{ slug(nav_blog) }">
              <span t-field="nav_blog.name"/>
            </a>
          </li>
        </t>
      </ul>
    </section>
  </xpath>
</data>

line 

<a t-attf-href="/blog/#{ slug(nav_blog) }">  

creates

 https://your_name.odoo.com/blog/-1  

and it is necessary

https://your_name.odoo.com/blog/1  

how to fix it?

 

Avatar
Discard
Author Best Answer

as I have understood at odoo server it will not pass?

Avatar
Discard
Best Answer

Install slugify python package https://github.com/un33k/python-slugify

pip install python-slugify

then slug function will create correct url even from non-english title

https://your_name.odoo.com/blog/nazvanie-zametki-1  (from russian Название заметки)

Avatar
Discard
Related Posts Replies Views Activity
1
Feb 24
1450
0
Nov 23
1560
1
Jul 21
1822
0
Sep 15
3441
0
Apr 15
3628