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
authorApp.getLocation();
/* 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
object-
location stringThe current view in the Author API.
-
locationEncoded stringThe 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.