Skip to content

Instantly share code, notes, and snippets.

@walterdavis
Created May 20, 2014 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walterdavis/588016f118c1ac304da5 to your computer and use it in GitHub Desktop.
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('/');
}
@joebillings
Copy link

Is this doing anything different to:

fwPage.fwWebAddress()

@walterdavis
Copy link
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