--- title: "Adding Tabbed Navigation to Portals" slug: "portal-tabs" updated: 2026-04-16T19:03:21Z published: 2026-04-16T19:03:21Z canonical: "knowledge.technolutions.net/portal-tabs" --- > ## Documentation Index > Fetch the complete documentation index at: https://knowledge.technolutions.net/llms.txt > Use this file to discover all available pages before exploring further. # Portal Tabs Adding **tabs** to a portal lets you divide information among interactive sections, which cuts down on scrolling and can improve the user experience.  #### Steps to creating a portal with tabs You’ll make a portal with tabs by following these steps: 1. Create a default view that holds the tab objects and any content that appears on all tabs, then a view for each tab. 2. Create a method for each of these views. 3. Create the tab framework in the default view using HTML (we provide the scaffolding). 4. Add the JavaScript we provide below this HTML to asynchronously load tab content. After these steps, we show you how to: - [style your tabs with CSS](/v1/docs/portal-tabs#styling-portal-tabs-with-css) - [display tabs conditionally](/v1/docs/portal-tabs#displaying-tabs-conditionally) - [get analytics scripts to report tab clicks as unique visits](/v1/docs/portal-tabs#analytics-for-tabbed-portals) ## Step 1: Creating views Portals use **views** to display content. On a portal with tabs, each tab is represented by a view. There is also a **default view**, which contains the tab menu items and any content that should appear no matter what tab is selected. > [!NOTE] > ➡️ Find steps for creating and configuring portal views in [Creating a Custom Portal → Creating portal views](/docs/creating-a-custom-portal#step-4-creating-portal-views). #### Creating the default view The **default view** contains code that creates selectable tag objects (which we’ll be adding later), plus any content you’d like to appear regardless of which tab is selected.  The default view is distinct from a *Home* tab (one that loads first before any selection is made). #### Tab view layouts Most tab views should use a **one-column layout**, particularly if the default view is a two-column or another partitioned layout. Avoid embedding a multi-column view in another a multi-column view. #### Moving existing content into new views If you’re adding tabs to an existing portal, you can move portal parts from one view to another with the **Move** button.  With a default view and a view for each tab created, we can make **methods** for each view. ## Step 2: Creating methods For each view, including the default view, we’ll create a corresponding **method**. We create a method to associate a tab object (which we create later) with a view. When that tab is selected, it calls the method we’ve given it, which, with help from some JavaScript we provide later, loads the specified view. Methods can also pull query results into the view, among other things. > [!NOTE] > ➡️ Find steps for creating portal methods in [Creating a Custom Portal → Adding portal methods](/docs/creating-a-custom-portal#step-2-adding-portal-methods). Create a method called **Default** and configure the following settings: - **Name:** An internal name for the method, like *Default*. - **Type:** GET - **Output Type:** Default Branding - **Action:** Leave this field blank. - **View:** Select the default tab view. For each **tab view** that you created in the previous section, create a corresponding method and configure the following settings: - **Name:** An internal name for the method. It’s often a good idea to give it the same name as the associated view. - **Type:** GET - **Output Type:** AJAX Popup/No Branding - **Action:** Enter a computer-friendly (lowercase letters and underscores only) name with a maximum of 32 characters. This value appear later, in the tab framework code, and also in the URL when the tab is selected. - **View:** Select the associated tab view you created in the previous step. In this example, the **Tab: Home** view is associated with a method named **Tab: Home** and an **Action** of `home`. .png) ## Step 3: Creating the tab framework on the default view In this step, we add an HTML scaffold using a `subtabs` list object that renders as the tabs at the top of the default view page. Each item has a `data-tab` HTML attribute; for example, `data-tab="home"`. This attribute values reference the **Action** of the Home method we created in the previous section. We then replace the placeholder values with method actions and tab labels. In the default view: 1. Select a **Static Content block** from the palette. 2. Configure the following settings: - **Name:** Enter an internal name for the block. - **Status:** Active - **CSS Class Name:** Enter a CSS class name for targeting by your institutional branding, if applicable. 3. Select **Source.** 4. Copy the following placeholder HTML and paste it in the source editor: ```xml
``` - This code creates an HTML unordered list `<ul>` with the class `subtabs`. Each list item `<li>` renders as a tab. - In each list item, there is an anchor `<a>` tag with the attribute `data-tab`. The value between the quotes references a **method action**. - The tab label is represented by the text inside the anchor tag. 5. For each list item `<li>`, replace the **placeholder value inside the quotes** for `data-tab` (`method_action_1`, `method_action_2`, …) with the **action** of the method that corresponds with the view you want to appear when that tab is selected. 6. Replace the **placeholder tab label (**`Tab Label 1`, `Tab Label 2`, …) with the name you want to appear on the tab. Here’s an example of how your HTML list might look: ```xml ``` ## Step 4: Adding JavaScript When a user selects a tab, we don’t want that action to reload the entire page. Instead, we’ll use some **JavaScript** to load the tab content, render it on the page dynamically, and update the current URL. Note that this code also contains some HTML: the `div` element with the ID `content_body` is a placeholder element which will contain the tab content once the JavaScript runs. In the default view, in the source editor of the static content block we created in the previous step: 1. Select **Source.** 2. Copy the following code: ```xml