Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
4317 Vistas

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
Descartar
Autor Mejor respuesta

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

Avatar
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
feb 24
1444
0
nov 23
1555
1
jul 21
1815
0
sept 15
3421
0
abr 15
3622