Author API Methods
getLocation()
Gets the current location of the Author app.
You would want to use this method so that you can detect which view the author is currently looking at, for example.
Examples
var authorLocation = authorApp.getLocation();
console.log(authorLocation);
/* When in the Item editor, may return:
{
"location": "items/10f60f73-60bd-4fdb-812a-728800af68e3",
"locationEncoded": "items/10f60f73-60bd-4fdb-812a-728800af68e3",
"route": "items/:reference"
}
*/
Arguments
None.
Return value
Type object
-
location string
The current view in the Author API.
-
locationEncoded string
The URI encoded version of the Author API location.
-
route string
Route matching the current Author API location.
See Building Your Own Author API User Journey Using .navigate() for more information.
Related articles
- The
navigate()
method, which allows you to navigate to a new view within the Author API.