site page buttons navigation.

Christos Christopoulos 35 Reputation points
2023-04-10T20:58:29.97+00:00

Hello, On a SharePoint page, I would like to add the buttons that you see on the left, and each time someone selects something from them,

I would like this to open in the right window as shown in the photo and not in a new page.

Is this possible? I am not interested in the site navigation bar that usually goes on the homepage. I am awaiting your response.

Image

Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2023-04-11T05:24:46.0733333+00:00

    Hi @Christos Christopoulos ,

    As far as I know, there is no such ootb web part to display the layout. You need to display react-script-editor in SharePoint Online. Then you can add custom js and css file to the modern page.

    <div class="row">
      <div class="col-4">
        <nav id="navbar-example3" class="h-100 flex-column align-items-stretch pe-4 border-end">
          <nav class="nav nav-pills flex-column">
            <a class="nav-link" href="#item-1">Item 1</a>
            <nav class="nav nav-pills flex-column">
              <a class="nav-link ms-3 my-1" href="#item-1-1">Item 1-1</a>
              <a class="nav-link ms-3 my-1" href="#item-1-2">Item 1-2</a>
            </nav>
            <a class="nav-link" href="#item-2">Item 2</a>
            <a class="nav-link" href="#item-3">Item 3</a>
            <nav class="nav nav-pills flex-column">
              <a class="nav-link ms-3 my-1" href="#item-3-1">Item 3-1</a>
              <a class="nav-link ms-3 my-1" href="#item-3-2">Item 3-2</a>
            </nav>
          </nav>
        </nav>
      </div>
    
      <div class="col-8">
        <div data-bs-spy="scroll" data-bs-target="#navbar-example3" data-bs-smooth-scroll="true" class="scrollspy-example-2" tabindex="0">
          <div id="item-1">
            <h4>Item 1</h4>
            <p>...</p>
          </div>
          <div id="item-1-1">
            <h5>Item 1-1</h5>
            <p>...</p>
          </div>
          <div id="item-1-2">
            <h5>Item 1-2</h5>
            <p>...</p>
          </div>
          <div id="item-2">
            <h4>Item 2</h4>
            <p>...</p>
          </div>
          <div id="item-3">
            <h4>Item 3</h4>
            <p>...</p>
          </div>
          <div id="item-3-1">
            <h5>Item 3-1</h5>
            <p>...</p>
          </div>
          <div id="item-3-2">
            <h5>Item 3-2</h5>
            <p>...</p>
          </div>
        </div>
      </div>
    </div>
    

    For more samples you can refer to following document

    https://getbootstrap.com/docs/5.3/components/scrollspy/

    For deployment of spfx you can refer to following document

    https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.