Frequently Asked Questions
The Frequently Asked Questions custom function grabs data from a Google spreadsheet (faqs) and displays the questions/answers in an accordian style list. Each museum will have a separate tab, and separate questions based on data from the spreadsheet.
The frequently asked questions block is emplimented by adding a code block to the page with the following:
Cook book
- Edit the page
- Click a “+” sign where you want to insert
- Select “Code”
- Paste the following code block
- Adust parameters as needed
Code block for frequently asked questions
<script>
$( document ).ready(function() {
// selector, ActiveTab, Single, OpenFirst, Collapsable, Collapsed
do_faqs2('#faq_container',2,false,true,true,false);
});
</script>
<div id="faq_container"></div>
Note: This example will place the resulting html code in the #faq_container selector (Selector). The second tab (ActiveTab) will be selected (Leslie Science). Since Single is set as false, all museum tabs will be visible. If Single was set to true then only Leslie Science would be showing. OpenFirst is set to true, which says that the first question will be automatically open on the initial display (unless on mobile). Collapsable is set to true, which says to add an expand/collapse toggle link above the tabs. Collapsed being false, says that the tabs will be initially expanded when page is first visited.
Overrides:
You can dynamically override ActiveTab by adding a parameter to the linking url as:
?tab=n (where n is a number from 1-4, see ActiveTab below)
Usage:
do_faqs2(Selector, Activetab, Single, OpenFirst, Collapsable, Collapsed)
Parameters:
Parameter | Description |
Selector | Required. jQuery selector identification where the resulting html code will be generated. |
ActiveTab | Optional.
|
Single | Optional.
|
OpenFirst | Optional.
|
Collapasble | Optional.
|
Collapsed | Optional. Collapsable must be set to true, otherwise this paramter is ignored.
|
Title | Optional. Title line at top, default is "View Location Maps" |
Return Value:
None
Google Spreadsheet:
Detail | Description |
Owner | aahom220@gmail.com |
File Name | FAQs |
Folder | UIL_Web_Site_Docs |
Link | FAQs Spreadsheet |
ID | 1f3G-ECzjt8p-czZNPyUQGXG8NND016Nue5QypQTf6PQ |
Sheet Name | FAQS |
Spreadsheet Fields
Column | Label | Description |
A | List | The museum code
|
B | Category | Not used |
C | Hide | Hide this question if value=Yes |
D | Question | The faq question |
E | Answer | The answer |
Example Screenshot