LinkItem external links converts to internal url - episerver

When adding a external url on my LinkItemCollection, EpiServer converts it to a internal page. Is there a way to disable this function?
Using Episerver 7.

LinkItem require you to invoke the method ToMappedLink or ToPermanentLink when working with external links.
https://world.episerver.com/documentation/class-library/?documentId=cms/7/ac6ab436-b0bb-3f26-dce4-b79230339d79

Related

Error while loading library mapsjs-core and mapsjs-service in salesforce lightning

I am trying to load Here maps library in lightning component but on load page is throwing below error.
[Cannot read property 'Object' of undefined]
eval()#https://wellmanage--onbdev.lightning.force.com/resource/GRG_Leaflet/GRG_Leaflet/Here-mapsjs-core.js:6:1666
Proxy.eval()#https://wellmanage--onbdev.lightning.force.com/resource/GRG_Leaflet/GRG_Leaflet/Here-mapsjs-core.js:320:26
According to the stack trace and error, it looks like the HERE scripts are loaded in an environment which doesn't have access to the JavaScript window object, and therefore cannot be evaluated properly.
I'm not familiar with Salesforce Lightning, but it should be possible to execute JavaScript code as their documentation states:
A component bundle can contain JavaScript code in a client-side controller, helper, or renderer. Client-side controllers are the most commonly used of these JavaScript resources.
However, it seems there is a peculiar way to load external scripts, which is described on this page. In particular:
The framework’s content security policy mandates that external JavaScript libraries must be uploaded to Salesforce static resources. For more information on static resources, see “Static Resources” in the Salesforce online help.

jQuery UI not loading when lightning component embedded inside VF on console

I am trying to use jQuery and jQuery UI in salesforce lightning component which is embedded inside VF page. This VF page is available on console for ex. domain/my.salesforce.com/console
When I run it I am able to load only jQuery version 3.2.1 inside this console, not other jquery versions are able to load.... fine I am happy with it. but next step is to load the jQuery UI version which should be compatible with jQuery 3.2.1.
But I am getting below error when jQuery UI loads in such scenario : lightning component embedded inside vf which is shown on console.
Jquery UI error:
Uncaught TypeError: n[o].hasOwnProperty is not a function
throws at /resource/jQuery_UITEST:8:5049
what I found is jQuery v2.2.4 and jQuery UI - v1.11.2 works together well when use purely as lightning app but do not work when I embed this lightning component inside vf and that vf is part of console.
If you have any idea kindly provide your inputs.
Thanks,
Akki
This question has been answered here:
https://salesforce.stackexchange.com/questions/180535/jqueryui-inputinputindex-hasownproperty-is-not-a-function
Simply said: All external libs that use the function hasOwnProperty are not working (yet) because the function has not been added to the LockerService SecureWindow object. Using an older version of jquery UI solves it for now (version 1.11.4 is supported)
When you embed lightning inside Visualforce, things do behave differently. Have you looked in your browser's console to see what JavaScript errors are being thrown? Typically you will see some related to CORS.
You then need to update your CORS settings in Salesforce to whitelist the URLS mentioned in the errors.
Use CORS for Lightning Out

Linking to an external url stored in MongoDB with Angularjs

I have a basic CRUD application written using the MEAN stack. In this I have an 'issues' model of which a number of properties are stored, including an external url which a user inputs.
I am trying to display this url so when the user clicks on it they are redirected to an external page (i.e. new tab in the browser). I am using Angular for this part.
With my current code I am always opening a new tab with the following url (http://localhost:3000/www.google.com). Taking the Google homepage as an external url example stored in the database.
My current code looks something like this.
view-issue.client.view.html
<a ng-href="{{ trustUrl(issue.sourceUrl) }}">Click me!</a>
issues.client.controller.js
$scope.trustUrl = function(url) {
return $sce.trustAsResourceUrl(url);
};
I have also tried this solution already posted with the same result (Linking to external URL with different domain from within an angularJS partial).
Thank you for any help you can provide!

Angular js with MVC: locationProvider.html5Mode(true) Links Does Not Work, becuse it want to get controller and action from Server

When using angular js routing by default add # after end of location link, and after # any other is the compiled by angular js,
if I want to not show # I can use locationProvider.html5Mode(true)
after route process for example my links in location convert from
http://example.com/#Name to http://example.com/Name
now if I create a link using <a href='/name'>test</a> it is works.
but when I use http://example.com/Name in address bar and enter, it is not works, and I get error about not found controller named Name controller
If you directly type the url in the browser, it makes a server request. In HTML 5 mode depending upon the server technology you would have to do url rewrite. This is what the documentation on location https://code.angularjs.org/1.2.15/docs/guide/$location has to say.
Server side
Using this mode requires URL rewriting on server side,
basically you have to rewrite all your links to entry point of your
application (e.g. index.html)

After removing the # from url, I lost direct access to my urls

in order to make nice urls, I decide to remove the # from my ulrs using the tip from the following question Removing the fragment identifier from AngularJS urls (# symbol) Now, I realized that my urls are not working if I try a direct access to them. from the given example in the related question if put the url below directly in the browser http://localhost/phones
I'll get a 404.
Any idea how to solve this?
You need to write server side code that will generate the page that you were previously depending on the client-side JavaScript to generate.
This will then be the initial view for that URL.
If the client supports JavaScript (and the JavaScript doesn't fail for any reason) it will then take over for future interactions.
Otherwise, the regular links and forms you (should) have in the page will function as normal without JS.

Resources