Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
4327 Widoki

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?

 

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź

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 Название заметки)

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lut 24
1459
0
lis 23
1568
1
lip 21
1829
0
wrz 15
3454
0
kwi 15
3663