websauna.system.core.breadcrumbs module

websauna.system.core.breadcrumbs.get_breadcrumbs(context, request, root_iface=None, current_view_name=None, current_view_url=None)[source]

Create breadcrumbs path data how to get to this resource from the root.

Traverse context Resource up to the root resource in the reverse order. Fill in data for rendering Bootstrap breacrumbs title. Each traversed resource must provide get_title() method giving a human readable title for the resource.

Parameters
  • current_view_name – Optional user visible name of the current view for the bottom most resource.

  • current_view_url – Full URL to the current view

  • root_iface (Optional[type]) – If you want to traverse only subset of elements and stop a certain parent, optional root can be marked with an interface. If not given assume websauna.system.core.interfaces.IRoot. Optionally traversing is terminated when reaching None as the __parent__ pointer.

Return type

List

Returns

List of {url, name, resource} dictionaries

websauna.system.core.breadcrumbs.get_human_readable_resource_name(resource)[source]

Extract human-readable name of the resource for breadcrumbs.

Return type

str