Commit d7392ffb authored by Tristan Cavelier's avatar Tristan Cavelier

erp5_xhtml_style: use short title in breadcrumb by default

parent 53475de1
...@@ -195,12 +195,16 @@ for name in relative:\n ...@@ -195,12 +195,16 @@ for name in relative:\n
obj = obj.restrictedTraverse(name)\n obj = obj.restrictedTraverse(name)\n
now.append(name)\n now.append(name)\n
if module:\n if module:\n
try:\n title = (\n
title = obj.getTranslatedTitleOrId()\n getattr(obj, "getTranslatedShortTitle", lambda: None)() or\n
except AttributeError:\n getattr(obj, "getTranslatedTitleOrId", lambda: None)() or\n
title = obj.Title()\n obj.getTitle() or obj.getId()\n
)\n
else:\n else:\n
title = obj.Title()\n title = (\n
getattr(obj, "getShortTitle", lambda: None)() or\n
obj.getTitle() or obj.getId()\n
)\n
if not name == \'talkback\':\n if not name == \'talkback\':\n
result.append( { \'id\' : name\n result.append( { \'id\' : name\n
, \'title\' : title\n , \'title\' : title\n
......
  • What about just using getCompactTranslatedTitle for both modules and non modules instead ?

    We are not translating "non module" documents because it was adding all titles to Localizer, but I think since we now have translated accessors it is not longer the case.

  • @jerome

    I did not know getCompactTranslatedTitle. It looks nice, I'll use it.

    However, do you think it's more consistent to have translated breadcrumb in classic erp5 view ? For instance, when you are viewing "agent" category, its short title is defined to "Agent", I think it is more consistent to have the same value in the breadcrumb :

    ERP5 / portal_categories / Function / Company / Agent /          I'm editing "Agent"
    ERP5 / portal_categories / Fonction / Entreprise / Employé /     Am I editing "Employé" ? looks confusing
  • getCompactTranslatedTitle is also used in domain trees, so it sounds consistent to me. It's probably better to open a merge request and ask others though.

  • Tristan Cavelier @tc

    mentioned in merge request !56 (merged)

    ·

    mentioned in merge request !56 (merged)

    Toggle commit list
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment