Created
April 26, 2012 22:57
-
-
Save Asherlc/2503952 to your computer and use it in GitHub Desktop.
SalsaV2
This file contains hidden or 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
<? | |
var title; | |
var description; | |
//Get all url parameters | |
var params = Request.getParameterList(); | |
//Find the very first parameter (always page key), grab the name and value | |
var page_param = params[0]['name']; | |
var page_id = params[0]['value']; | |
//Strip out the '_KEY' string, so we get just the page type | |
var page_type = page_param.replace('_KEY',''); | |
//Query the DB object for the current page | |
var page = DB.getObject(page_type, page_id); | |
//Combine the information we have to rebuild the current URL | |
var page_url = Request.getURL()+page_param+page_id | |
switch (page_type) | |
{ | |
case 'signup_page': | |
description = page.preFooter; | |
title = page.Title; | |
break; | |
case 'donate_page': | |
description = page.Custom_Donation_HTML; | |
title = page.Reference_Name; | |
break; | |
case 'action': | |
description = page.Footer; | |
title = page.Title; | |
break; | |
case 'event': | |
description = page.Description; | |
title = page.Event_Name; | |
break; | |
case 'content_item': | |
description = 'Custom content item'; | |
title = page.Title; | |
break; | |
default: | |
description = 'Salsa page'; | |
title = 'Title'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment