Skip to content
Richard Všianský edited this page May 30, 2019 · 15 revisions

Breadcrumbs help to expose the hierarchy, not the particular clicks of a user. Its logic is more clear and most of it is only in one Mixin, not scattered throughout the code.

Table of Contents
  • this design follows Patternfly guidelines
  • First, show the path from the navigation (E.g.: Compute > Infrastructure > Providers)
  • Only breadcrumbs which lead somewhere should be clickable (last breadcrumb in the menu, etc.)
  • The end of the breadcrumb string should represent the page a user is currently viewing
  • When using breadcrumbs, be sure to include them on every page throughout the application.
    • Exception: when content is shown on in a separate window without navigation (ex. reports), breadcrumbs are not required

breadcrumbs

Examples

1) Explorer screens

  • Show the tree path in the breadcrumbs includes accordion header

    Default

    Screenshot from 2019-05-13 10-30-38

    Detail

    Screenshot from 2019-05-13 11-01-49

    Detail action

    Screenshot from 2019-05-13 10-31-16

    Action

    Screenshot from 2019-05-13 11-02-40

    Tagging/Ownership/etc.

    • Show the item breadcrumb only when there is only one item

    One item

    Screenshot from 2019-05-13 11-04-37

    More items

    Screenshot from 2019-05-13 11-05-41

    Ancestry

    image

    • only Services. Services are missing hiearchy in the tree (because of performance).

    Filters

    • are not a part of the hiearchy

    Screenshot from 2019-05-13 11-05-56

2) Non-explorer screens

Default [deprecated image]

Screenshot from 2019-05-13 10-32-02

  • There could be a different header on the landing page - that is a longer version of the item in the menu. Breadcrumbs should contain the same name as in the menu - the shorter version.

Detail Screenshot from 2019-05-16 10-20-57

Detail Action/Action

Screenshot from 2019-05-13 10-32-28

Tagging/Ownership/etc.

  • Show item breadcrumb only when there is only one item

One item Screenshot from 2019-05-13 10-32-42

More items Screenshot from 2019-05-13 10-36-01

Usage

A controller should include Breadcrumbs mixins:

include Mixins::BreadcrumbMixin

and then it has to define a new method:

def breadcrumbs_options

  • which returns a hash with variables depended on the controller and its type:
{
:breadcrumbs    => ..., 
:include_record => ..., 
:record_info    => ...,
:record_title   => ...,
}

All controllers should contain:

{
:breadcrumbs => [
  { :title => ... , :url => ?, :key => ? }
  ]
}
  • which sets a way in the main navigation menu:

  • :title - title of the breadcrumb, eg. _('Cloud Providers)'

  • :url - url, eg. controller_url

A breadcrumb can have also:

  • :key - using in tree views, key for the item, eg. root
  • :action - additional action for using with the key, eg. accordion_select

Variables

All variables are optional.

:record_info => @ems

  • some controllers use different variables to store information about a current item. Most of them are using @record, which is a default variable. If not, then you have to manually set which variable is used.

:record_title => :key

  • Method which stores a title of the variable set in the record_info ( :title = @ems.key )

Explorer controllers

:include_record => true

  • when the title of the shown item is missing, e.g. in edit actions. Mostly used when trees do not contain all nodes.

Schema of breadcrumbs flow [deprecated - needs to be updated]

Untitled Diagram

Clone this wiki locally