Commit a1e5b283 authored by Kevin Deldycke's avatar Kevin Deldycke

Try to get title, short_title then id to construct the breadcrumb.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7691 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 89bccdfe
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>Python_magic</string> </key> <key> <string>Python_magic</string> </key>
<value> <string encoding="base64">bfINCg==</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>Script_magic</string> </key> <key> <string>Script_magic</string> </key>
...@@ -71,10 +73,10 @@ ...@@ -71,10 +73,10 @@
html_list = []\n html_list = []\n
\n \n
for crumb in context.WebSite_getBreadcrumbValue():\n for crumb in context.WebSite_getBreadcrumbValue():\n
text = None\n if crumb.getTitle() is None or crumb.getTitle() == \'\':\n
for property in (\'title\', \'short_title\', \'id\'):\n text = crumb.getId()\n
if text in (None, \'\') and hasattr(crumb, property):\n else:\n
text = getattr(crumb, property)\n text = crumb.getTitle()\n
html_list.append(\'<a href="%s">%s</a>\' % (crumb.WebSite_getUrl(), text))\n html_list.append(\'<a href="%s">%s</a>\' % (crumb.WebSite_getUrl(), text))\n
\n \n
return \' &gt; \'.join(html_list)\n return \' &gt; \'.join(html_list)\n
...@@ -90,7 +92,7 @@ return \' &gt; \'.join(html_list)\n ...@@ -90,7 +92,7 @@ return \' &gt; \'.join(html_list)\n
</item> </item>
<item> <item>
<key> <string>_filepath</string> </key> <key> <string>_filepath</string> </key>
<value> <string>Script (Python):/erp5/portal_skins/erp5_web/WebSite_getBreadcrumb</string> </value> <value> <string>Script (Python):/nexedi/portal_skins/erp5_web/WebSite_getBreadcrumb</string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
...@@ -127,9 +129,6 @@ return \' &gt; \'.join(html_list)\n ...@@ -127,9 +129,6 @@ return \' &gt; \'.join(html_list)\n
<string>crumb</string> <string>crumb</string>
<string>None</string> <string>None</string>
<string>text</string> <string>text</string>
<string>property</string>
<string>hasattr</string>
<string>getattr</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
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