From: Jean J. <je...@up...> - 2004-07-07 16:23:37
|
> Here is a tidbit if you are tired of seeing triplicate i.e. I18NLayer's "you > are here: Welcome to Plone > Welcome to Plone > Welcome to Plone" I added 'I18NLayer' to a custom breadcrumbs's dont_show_metatypes:: dont_show_metatypes = ['TempFolder', # Metatypes of objects we wont show 'Plone Factory Tool', 'Plone Form Tool', # (This will make breadcrumbs lazy if # you change browser preference: the URL will # still be pointing at a specific language. Maybe # there's a setting on 'portal_languages' that # will mitigate this) 'I18NLayer', ] For news, events and topics I made 'custom/filterI18NLayerItems' like so (takes proxies as parameter):: """ We don't want duplicates of I18Nized items to be returned. Return the I18NLayer representing the item instead of the item itself. """ filtered = [] for p in proxies: obj = p.getObject() if not obj: continue if obj.aq_parent.portal_type == 'I18NLayer': i18n_obj = obj.aq_parent if i18n_obj not in filtered: filtered.append(obj.aq_parent) else: filtered.append(obj) return filtered -- Jean Jordaan http://www.upfrontsystems.co.za |