Skip to content

Instantly share code, notes, and snippets.

@walterdavis
Created May 20, 2014 13:19
Show Gist options
  • Select an option

  • Save walterdavis/588016f118c1ac304da5 to your computer and use it in GitHub Desktop.

Select an option

Save walterdavis/588016f118c1ac304da5 to your computer and use it in GitHub Desktop.
Get a complete URL of the current page in a Freeway Action
function complete_url(){
var site = fwDocument.fwWebAddress();
if(site.length < 1)
fwAbort('Please set the Web Address in Document Setup before publishing');
var folder = fwPage.fwFolder;
var path = new Array(fwPage.fwFileName);
while(folder.fwFolder){
path.push(folder.toString());
folder = folder.fwFolder;
}
path.push(site.replace(/\/$/, ''));
return path.reverse().join('/');
}
@walterdavis
Copy link
Copy Markdown
Author

Wow, blast from the past. I didn't see your comment, obviously. Yes, this is adding the entire path to the current page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment