Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
4318 Zobrazení

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
Zrušit
Autor Nejlepší odpověď

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

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
úno 24
1446
0
lis 23
1559
1
čvc 21
1817
0
zář 15
3433
0
dub 15
3626