This code logs you out and then reloads the current community instead of sending you to the guest community.
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:
Use Javascript to target selected link and add the selected class on parent “li”

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