Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi folks! Trying to get the url for the current node in a content-app: the urls are listed in a collection named currentUrls (?), but where do I find it in the controller?
The url is to be displayed in an iframe in the content-app.
iframe
Hi Ulf!
I think you could use $location
$location
Eg.
angular.module("umbraco").controller("controller", function ($location) { console.log($location.$$url) }
//Johannes
$location would give you the current URL in the browser (to the backoffice item) but are you looking for the frontend URL to the content item?
Have a look at injecting the editorState into your controller, example:
https://github.com/enkelmedia/Umbraco-SeoVisualizer/blob/v9/SeoVisualizer/App_Plugins/SeoVisualizer/SeoVisualizerController.controller.js
Basically injecting it and use:
var allUrls = editorState.getCurrent().urls
Also note that a page can have multiple urls, depending on language/host name settings.
Cheers!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Angular: get the current nodes url
Hi folks! Trying to get the url for the current node in a content-app: the urls are listed in a collection named currentUrls (?), but where do I find it in the controller?
The url is to be displayed in an
iframe
in the content-app.Hi Ulf!
I think you could use
$location
Eg.
//Johannes
$location would give you the current URL in the browser (to the backoffice item) but are you looking for the frontend URL to the content item?
Have a look at injecting the editorState into your controller, example:
https://github.com/enkelmedia/Umbraco-SeoVisualizer/blob/v9/SeoVisualizer/App_Plugins/SeoVisualizer/SeoVisualizerController.controller.js
Basically injecting it and use:
var allUrls = editorState.getCurrent().urls
Also note that a page can have multiple urls, depending on language/host name settings.
Cheers!
is working on a reply...