Skip to content

Mainnavigation: no default setting for an active item #394

Open
@mfranzke

Description

@mfranzke

We should mention that the site authors / component consumers would actively need to mark up one of the main navigation items as the active one as we couldn't determine it or even "just" define the first one as the default if none is defined, as this is totally up to the page or application it is integrated in.

We should even also mention the following aspects, that our developer colleagues would benefit from (at least for understanding the solution):

Example Angular: Set routerLink as directive on <db-link>. You'll retrieve the Active State out of the RouterLinkActive directive:

<db-mainnavigation>
  <db-link routerLink="/home" routerLinkActive #rlaHome="routerLinkActive" [current]="{ 'page' : rlaHome.isActive }">
    Startseite
  </db-link>
  <db-link routerLink="/about" routerLinkActive #rlaAbout="routerLinkActive" [current]="{ 'page' : rlaAbout.isActive }">
    About
  </db-link>
</db-mainnavigation>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions