-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
92 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,22 @@ | ||
# silverstripe-imagegallery | ||
# silverstripe-faqpage | ||
|
||
A module for the SilverStripe CMS which allows you to display a bunch of images | ||
in a gallery format. | ||
A module for the SilverStripe CMS which allows you to present a searchable list | ||
of frequently asked questions. | ||
|
||
## Why? | ||
|
||
We needed a simple way to present a set of images that can be easily navigated | ||
on any device. | ||
We needed a simple way to present a set of searchable list of question/answer | ||
pairs. | ||
|
||
## Installation | ||
|
||
```sh | ||
composer require "logicbrush/silverstripe-imagegallery" | ||
composer require "logicbrush/silverstripe-faqpage" | ||
``` | ||
|
||
## Usage | ||
|
||
Install the module and you'll have a new page type of "Gallery Page". You can | ||
add and reorder images to the page from the "Images" tab in the CMS. | ||
Install the module and you'll have a new page type of "FAQ Page". You can | ||
add child "Question" pages and manage them independently. | ||
|
||
In addition, this module provides a widget for displaying a gallery in a | ||
sidebar. Add it to your WidgetArea and select the gallery you wish to display. | ||
|
||
|
||
## Configuration | ||
|
||
Select which column to sort the images by, via the "Sort By" dropdown. | ||
Selecting "Newest First" will sort the images by "Created" in DESC order. | ||
Selecting "Position" will sort the images by "SortOrder" in ASC order. | ||
|
||
Reordering the images manually will only have effect if "Position" is selected. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.faq-section-heading.hidden, | ||
.faq-table-of-contents>li.hidden, | ||
.faq-table-of-contents>li>.content.hidden { | ||
display: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
jQuery(document).ready(function() { | ||
|
||
/** FAQ filtering... **/ | ||
jQuery('.faq-filter-form').on('submit', function(e) { | ||
e.preventDefault(); | ||
}); | ||
jQuery('.faq-filter').on('keyup.faq-filter, change.faq-filter', function() { | ||
var searchVal = jQuery(this).val().toLowerCase(); | ||
var faqTableOfContents = jQuery('.faq-table-of-contents'); | ||
var filterItems = faqTableOfContents.find('li'); | ||
var faqHeadings = jQuery('.faq-section-heading'); | ||
|
||
filterItems.removeClass('hidden'); | ||
faqHeadings.removeClass('hidden'); | ||
|
||
if (searchVal != '') { | ||
filterItems.each(function() { | ||
var itemContent = jQuery(this).text().toLowerCase(); | ||
if (itemContent.indexOf(searchVal) < 0) { | ||
jQuery(this).addClass('hidden'); | ||
} | ||
}); | ||
} | ||
|
||
faqTableOfContents.each(function() { | ||
if ($(this).find('> li.hidden').length === $(this).find('> li').length) { | ||
jQuery(this).prev('.faq-section-heading').addClass('hidden'); | ||
} | ||
}); | ||
}).trigger('change.faq-filter'); | ||
|
||
/** Accordian behavior... */ | ||
jQuery('.faq-table-of-contents>li>a').each(function() { | ||
$(this).on('click', function() { | ||
$(this).next().toggleClass('hidden'); | ||
return false; | ||
}); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
<?php | ||
/** | ||
* src/Model/QuestionTag.php | ||
* | ||
* @package default | ||
*/ | ||
|
||
|
||
namespace Logicbrush\FAQPage\Model; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters