Hello everyone,
At the moment, portals do not support adding external links to the sidebar. However, there is a simple workaround you can use. You can create a sidebar item, such as a content page, and add custom code that redirects users to an external URL when they click it.
Add the script below to the Body custom code section of your workspace or portal.
<script>
(function () {
const TARGET_LABEL = "this is a hyperlink";
const REDIRECT_URL = "https://example.com";
document.addEventListener(
"click",
function (event) {
const button = event.target.closest("button");
if (!button) return;
const label = button.querySelector("p");
if (!label) return;
if (label.textContent.trim() === TARGET_LABEL) {
event.preventDefault();
event.stopPropagation();
event.stopImmediatePropagation();
window.location.href = REDIRECT_URL;
}
},
true
);
})();
</script>
Please replace TARGET_LABEL with the exact name of the navigation/menu item you want to turn into a link.
Then replace https://example.com with the external URL you want users to be redirected to.