umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.54k stars 2.71k forks source link

Add Multi Url Picker to core #2967

Closed bjarnef closed 5 years ago

bjarnef commented 6 years ago

It would be great to add the Multi Url Picker to core. We use it in almost every project, e.g. for footer links where it often needs to be a combination of internal and external links and links to media items.

The original issue on the old issue tracker: https://issues.umbraco.org/issue/U4-8930

A PR is already submitted here: https://github.com/umbraco/Umbraco-CMS/pull/2323 but it might need to be updated with latest changes in v2.2.0 and for latest Umbraco version.

snerpton commented 6 years ago

This is a great idea!

JohnBertelsen commented 6 years ago

Or maybe add the ability to select media in the Related links picker.

drummerboy46 commented 5 years ago

Ha, I've actually moved away from the Related Links picker to the RJP one.

Can we ensure the RJP version remains compatible with the Umbraco version? I recall this was a problem with nested content when it came into the core.

The UI/UX for related Links is a really bad fit for the backoffice and it should be shelved in favour of the RJP one. You really notice the poor UI in RL when trying to embed one in a nest content, the table busts all too easily out of it's container. I have raised a ticket about this.

drummerboy46 commented 5 years ago

If I was to request one feature in the configuration, the ability to decide what pickers are enabled...

Internal content picker External Urls with query Media picker

nul800sebastiaan commented 5 years ago

@drummerboy46 The plugin and the core versions have a different alias, they will remain separated on upgrades. RJP version is still compatible,

RelatedLinks has been obsoleted and won't show up any more unless you're upgrading with an existing RelatedLinks datatype added.

This has now been merged for a 7.14 release! 🎉

DanDiplo commented 5 years ago

@nul800sebastiaan Just be aware that this can break peoples' builds when upgrading from a site that already uses RJP MulitUrlPicker. I just upgraded a site and had build errors because:

'Link' is an ambiguous reference between 'RJP.MultiUrlPicker.Models.Link' and 'Umbraco.Web.Models.Link'

This will happen to any projects that have the RJP.MultiUrlPicker.Models namespace and the Umbraco.Core.Models namespace referenced in the same file.

bifort commented 5 years ago

Hi @nul800sebastiaan ,

Not sure if this is only me, but when upgrading via nuget from 7.13.2 to 7.14.0 and trying to use the new Multi Url Picker data type I get following error:

angular.min.js?cdv=1463409266:63 Error: Argument 'Umbraco.PropertyEditors.MultiUrlPickerController' is not a function, got undefined
    at cb (angular.min.js?cdv=1463409266:17)
    at xa (angular.min.js?cdv=1463409266:17)
    at angular.min.js?cdv=1463409266:53
    at angular.min.js?cdv=1463409266:44
    at n (angular.min.js?cdv=1463409266:7)
    at k (angular.min.js?cdv=1463409266:44)
    at e (angular.min.js?cdv=1463409266:40)
    at angular.min.js?cdv=1463409266:39
    at angular.min.js?cdv=1463409266:158
    at angular.min.js?cdv=1463409266:100
bifort commented 5 years ago

Hi @nul800sebastiaan, is there any update on this issue?

nul800sebastiaan commented 5 years ago

@bsowa Sounds like an upgrade problem to me, make sure to get some help on the forum at https://our.umbraco.com/

bifort commented 5 years ago

@nul800sebastiaan I just figured it out! You guys forgot to include the file multiurlpicker.controller.js under /umbraco/views/propertyeditors/multiurlpicker/

The file is not part of nuget or the zip installation! It is only available in the github repo... (https://github.com/umbraco/Umbraco-CMS/tree/release-7.14.0/src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker)

So I guess you will hear of this issue more and more, when people will start using v7.14.

nul800sebastiaan commented 5 years ago

@bsowa - all those files get combined into umbraco.controllers.js, the code is all there :)

image

Maybe try all of this: https://cultiv.nl/blog/how-to-diagnose-umbraco-upgrade-problems/ and if you still have problems make sure to post on the forum. :)

bifort commented 5 years ago

@nul800sebastiaan oh right - the .js file shouldn't be there as this is the views folder. Duh. I think this was just a weird caching issue - I have followed the instructions from your website and it is working now. Increasing the clientDependency version number did the trick. Thanks :)

viksohal commented 5 years ago

Hi @nul800sebastiaan , There is still an issue with the link picker when used in a macro, "ignoreUserStatusNodes" comes as null, I did a null check for this and that has fixed it but that js file will get overwritten with a clean build. This is the error we are getting.

TypeError: Cannot read property 'ignoreUserStartNodes' of null at Object.$scope.openLinkPicker (umbraco.controllers.js?cdv=20190810:16193) at angular.min.js?cdv=20190810:74 at angular-mobile.js?cdv=20190810:270 at Object.$eval (angular.min.js?cdv=20190810:92) at Object.$apply (angular.min.js?cdv=20190810:92) at HTMLAnchorElement. (angular-mobile.js?cdv=20190810:269) at HTMLAnchorElement.dispatch (jquery.min.js?cdv=20190810:3) at HTMLAnchorElement.r.handle (jquery.min.js?cdv=20190810:3)

For temp fix I have updated the umbraco.controller.js line 16192 to dataTypeId: $scope.model && $scope.model.dataTypeId ? $scope.model.dataTypeId : null, ignoreUserStartNodes: ($scope.model.config && $scope.model.config.ignoreUserStartNodes) ? $scope.model.config.ignoreUserStartNodes : "1",