Skip to content

Instantly share code, notes, and snippets.

@Asherlc
Created April 26, 2012 22:57
Show Gist options
  • Save Asherlc/2503952 to your computer and use it in GitHub Desktop.
Save Asherlc/2503952 to your computer and use it in GitHub Desktop.
SalsaV2
<?
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