1

I'm in the process of updating our main page and we have a FAQ section. Right now we have a hyperlink that is the question and when clicked, it takes the user to a sharepoint pdf that has the answer. I'm looking for suggestions on how the below screenshot can be accomplished or if SharePoint even has this functionality?

Before button is clicked

After button is clicked

Below is our current sharepoint setup:

Sharepoint

enter image description here

1 Answer 1

1

As you are using SharePoint Online, I will suggest you to create a SharePoint Framework webpart for your requirements.

Check below official documentation of adding JQuery accordion in SPFx webpart:

Add jQueryUI Accordion to your SharePoint client-side web part.

Note:

This webpart is using static data to show in accordion. So:

  1. You can create a SharePoint list and add all your FAQs in that.
  2. Then use SharePoint REST APIs (SPHTTPModule or PnPJS) to fetch the list items and then show it in accordion.

Retrieve SharePoint List Items Using SharePoint Framework Development Model.

Update:

If you are using classic Sharepoint maybe 2019/2016/2013 then you can check below some samples to achieve something similar:

  1. Implementation Of Jquery Accordion For SharePoint List Data - Using JSOM.
  2. Displaying items using JQuery Accordion Widget - Using REST APIs.
8
  • Thank you for a great answer! I think that would be outside the scope of our current software (we currently don't have Visual Studios license). Our next option I think would just be to have the FAQs answers hidden below the link and have it display once a user clicks on the hyperlink. Very helpful and I might try your suggestion on my personal PC.
    – Noah
    Jan 30, 2020 at 17:40
  • You don't need Visual studio licences to build SPFx webpart. You will need NodeJS to create a solution using yeomen generator and then you can use any code editor(Visual Studio Code open/free software recommend but not compulsory) of your choice to write/edit code. That's the beauty of SPFx. It is a client side solution. Jan 30, 2020 at 17:49
  • Also, if you are using classic sharepoint sites and has access to content editor/script editor then you can get the list items using SharePoint REST API/JSOM and bind it to JQuery accordion. Jan 30, 2020 at 17:50
  • 1
    I've added some pictures to hopefully clear up which version of sharepoint we're using:
    – Noah
    Jan 30, 2020 at 18:00
  • 1
    You're a life saver Ganesh. Thank you again! :)
    – Noah
    Jan 30, 2020 at 19:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.