Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
( function ( workspace, $ ) {
//we keep track of previous refinement item matches in this array
var matches = [];
//this is where we keep track of our refinement items for the Workspace refiner
var workspaceItems;
workspace.Mapping = {
//straight site collection one to one mapping on SPSiteURL. This is detailed in the first part of the scenario.
Simple: {
'Mappings': [
{ 'Label': 'News', 'Relative': '/sites/news' },
{ 'Label': 'Help', 'Relative': '/sites/help' },
{ 'Label': 'Search', 'Relative': '/sites/search' },
{ 'Label': 'Location', 'Relative': '/sites/location' }
],
'RegExpValues' : [
/^\/sites\/news/,
/^\/sites\/help/,
/^\/sites\/search/,
/^\/sites\/location/
]
},
//Used for sounds like matches (e.g. /sites/essentials, /sites/essentials-hr etc..)
Standard: {
'Mappings': [
{ 'Label': 'Essentials', 'Relative': '/sites/essentials' },
{ 'Label': 'Projects', 'Relative': '/sites/project' },
{ 'Label': 'Bids', 'Relative': '/sites/bid' }
],
'RegExpValues': [
/^\/sites\/essentials/,
/^\/sites\/project/,
/^\/sites\/bid/
]
},
//used for multiple differing URL mappings for the communities IA (e.g /sites/communities, /sites/community, /sites/water, /sites/rail-engineering etc..)
Community: {
'Mappings': [
{
'Label': 'Communities', 'Relative': '/sites/communities',
'Label': 'Communities', 'Relative': '/sites/communityengagement',
'Label': 'Communities', 'Relative': '/sites/engineeringpractice',
'Label': 'Communities', 'Relative': '/sites/itdecisions',
'Label': 'Communities', 'Relative': '/sites/communicatingsuccess'
}
],
'RegExpValues' : [
/^\/sites\/communities/,
/^\/sites\/engineeringpractice/,
/^\/sites\/itdecisions/,
/^\/sites\/communicatingsuccess/
]
},
...
})( MyCompany.MyProject.Search.Workspace = MyCompany.MyProject.Search.Workspace || {}, jQuery );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment