Logout and stay within current community

This code logs you out and then reloads the current community instead of sending you to the guest community.

Modify Navigation portlet to style selected links

The Problem:

By Default the Navigation Portlet doesn’t traverse the selected class up to the root element; only to the current page that is selected.
If the Nav tree is deep of levels, if set to add the selected class by default it could cause some loading time issues

Notice in this picture Page1 isn’t bold, because the selected class isn’t added to it.

This is the html markup of the navigation portlet by default with the following Customizations:

  • Display Style: Custom
  • Header: Root Layout
  • Root Layout: Parent at Level
  • Root Layout Level: 0
  • Included Layouts: All
  • Nested Children: Yes

Solution:

Use Javascript to target selected link and add the selected class on parent “li”


This is what the result looks like:

Here is the final html mark code, see that the parent “li” has selected class name.

Syze: Think @media queries powered by Javascript

syze is a library for JavaScript that lets you easily target your designs by device or browser sizes. syze makes designing for desktops, televisions, tablets, and mobile devices simultaneously as easy as CSS. syze works before page load so there is no flicker. Size can update on window resize and orientation change - it works cross-browser, cross-device, cross-library and is less than 1KB.

created by Jonathan Neal