AEM - External links appended to current page - url

When adding external urls in any component with field, say pagefield or pathfield, it doesnt open the external link, but appends it to the current path
eg: property given - http://www.google.com
when clicked, it goes to
http://localhost:4502/content/wknd/home/us/en/test456/http://www.google.com
is there any setting or config?

Related

How to change URL names in Umbraco

This is my first time round using Umbraco and I have created Document Types / Pages using the wrong naming format and now this has transpired into my page URL's, for instance /about-page/. How would I go about changing them to /about as I have searched the back-end admin panel and there dose't seem to be an option to change their link to document values.
Would anyone be able to provide a simple code based example using umbracoUrlAlias or umbracoUrlName how I could change this preferably in Razor.
Thanks
Editing #run yards Solution by digbyswift help in comment
Correct Solution:
Create Property on in Document Types which applies to all pages you want to change the URL
Call the name anything you want e.g Page URL and Possibly give it a new tab.
Call the alias umbracoUrlName
Type as text sting
Should not be Mandatory (As when you start replacing .Url with .umbracoUrlAlias within the views it will need to be present)
Tab as Generic
Click Save on top right on the page
Added screenshot for starter kit on Umbraco v7.2.5
Unless I'm very much misunderstanding your issue, you should just be able to change the name of your page and republish. This doesn't need an additional field, just change the value in the "Properties" tab and republish the page. This will automatically change the URL of the page.
You can also create a property called umbracoUrlName using a TextString property editor. If this has a value then it will generate the URL fragment for the page using this value, rather than the page name. This changes the URL for the page, rather than creating an alias, like umbracoUrlAlias.
Solution:
Create property on in Document Types which applies to all pages you want to change the URL
Call the name anything you want e.g Page URL and Possibly give it a new tab.
Call the alias umbracoUrlAlias
Type as text sting
Make it required (As when you start replacing .Url with .umbracoUrlAlias within the views it will need to be present)
Go into all your pages and rename them using the property you just created
Now with your code, say with the navigation where you have used .Url change it to .umbracoUrlAlias and the new URL's will be used.
Note if you don't use .umbracoUrlAlias the links will still be active i.e. they work but they won't be displayed in the address bar as .Url spits out the original ones associated with the page.
You can apply on URL names in web.config:
In section find:
<add key="umbracoUseDirectoryUrls" value="false" />
this will set url names for new created items to name.aspx
If you set this to 'true' then new items will be named like /name/
Additionaly you might want to avoid of Handling some urls by Umbraco pipline, just use this setting - add URLs which must be bypassed:
<add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd" />

How to Display stored image in html in database into view with razor engine

I have a section that saves html created with an html editor into a database in the site control panel.
in my html if I insert image with this address "image/Picture1.jpg" using the html editor if there is a image stored at mysite.com/image/picture1.jpg.
Now in a view(razor) I display the stored html content from the database with System.Web.HttpUtility.HtmlDecode or #Html.Raw(item.Content). if this content is shown the in home page like mysite.com it works correctly.
but, if it show it in other area or controller or action the image doesn't show. Because in those areas (like mysite.com/desktop) the image address changes to mysite.com/desktop/image/picture1.jpg.
How do I display this html content without this problem?
The images will always be relative to the page that displays them as you are using a relative URL.
Unless they have an absolute URL mysite.com/image/picture1.jpg or a root-relative URL /image/picture1.jpg in the HTML it will not work.
A: You need to enter the URL in the HTML editor as either absolute
mysite.com/image/picture1.jpg
or root-relative:
/image/picture1.jpg
In both cases the browser will search from root of the website, and not just relative to the current page.

Google Earth KML - href fragment URL getting cut off at the # - won't open in browser

I have a KML file that includes a list of placemarks. In the placemark description I have links that point to a webpage I want users to open in a browser. The href points to a fragment URL, meaning it has a '#' as a delimiter, followed by a parameter related to the placemark. When I view the placemark balloon I see the clickable link, but when I click it sends the URL to the browser cutting off the '#' and the parameter that follows. However if I right-click on the link, copy link location, and paste it into a browser it works fine...I'd like to avoid those few extra steps though.
The link looks like this: mywebsite/directory#12345678
but it opens in the browser like this: mywebsite/directory
which doesn't work.
From some searching around I see the # is used to enable fly to features (see below). Is there a workaround or fix so that I can make google earth send the complete fragment URL to the browser, without cutting off the # and parameter?
--from Google Earth deveopers group
Other Behavior Specified Through Use of the Element
KML supports the use of two attributes within the element: href and type.
The anchor element contains an href attribute that specifies a URL.
If the href is a KML file and has a .kml or .kmz file extension, Google Earth loads that file directly when the user clicks it. If the URL ends with an extension not known to Google Earth (for example, .html), the URL is sent to the browser.
The href can be a fragment URL (that is, a URL with a # sign followed by a KML identifier). When the user clicks a link that includes a fragment URL, by default the browser flies to the Feature whose ID matches the fragment. If the Feature has a LookAt or Camera element, the Feature is viewed from the specified viewpoint.
The behavior can be further specified by appending one of the following three strings to the fragment URL:
•;flyto (default) - fly to the Feature
•;balloon - open the Feature's balloon but do not fly to the Feature
•;balloonFlyto - open the Feature's balloon and fly to the Feature
I'd greatly appreciate any ideas, suggestions, or workarounds!
If the target URL "mywebsite/directory" results in an HTML document with a target id defined with appropriate anchor (e.g. 1234578) then it normally can be accessed via clicking a link via KML from Google Earth.
There may be an issue with how the URL is escaped in the KML. Wrapping HTML in the feature description via CDATA block sometimes helps.
Here's where having a '#' in the URL for a link in KML works as you'd expect.
KML
<?xml version='1.0'?>
<kml xmlns='http://www.opengis.net/kml/2.2'>
<Placemark>
<description>
<![CDATA[
Visiting a linked resource.
See reference
]]>
</description>
</Placemark>
</kml>
Target HTML links.html
<html>
...
<h3><a name="h-12.1.1">12.1.1</a> Visiting a linked resource</h3>
...
</html>
The behavior might be different whether the web browser is configured as external or internal to Google Earth. In Tools/Options/General menu check/uncheck the option "Show web results in external browser" to see if the action changes.

ASP.NET, MVC, C# website pass a value though out the application

This is a bit of a puzzle for me.
I need to capture the URI Query string passed to the Home page.
As a user travels to different pages on the web site, I have a partial view that needs that URI query string.
I need a dynamicly created link in the partial view, that equals the original call to the home page.
Example -
If the user goes to - http://www.mysite.com?mode=Joe , I need the dynamicly created link to equal - Http://www.mysite.com?mode=Joe
If the user goes to - http://www.mysite.com?mode=Tommy , I need the dynamicly created link to equal - Http://www.mysite.com?mode=Tommy
FYI - The partial view is used in the _Layout.cshtml file. the call inside - _Layout.cshtml looks like this -
#Html.Partial("MyPartial")
Thanks!
There are a number of ways to do this, but probably the simplest would be to save it to the session on your home page, and then access that session variable from your partial.
You will need to decide what to do if the session expires.
Another possible way would be to write it to a cookie on the home page request and then access the request cookie in your partial. Again, you'd need to decide on an approach for cookies disabled, or wiped out during browsing.
Alternatively, you could look at something like the approach being used in the link below to set a language across the site. Exact implementation would differ, but concept is the same:
Howto automatically add a specific value from current route to all generated links?

SSRS create hyperlink on report to aspx page of my application with some value as querystring.

I want to send SSRS report field as querystring paramater to my application page. for this I have done following steps:
To add a hyperlink in report:
In report design view, right-click the text box I want to add a link and then click Properties.
1.In the Properties dialog box, click Action.
2.Select Go to URL. An additional section appears in the dialog box for this option.
3.In Select URL, in expression that evaluates to a URL, in pasted my pages url and concatenated it with field value in the below manner.
http://localhost:64970/InvoiceManagement.aspx?a=Fields!INVOICE_NUMBER.Value
Click OK.
but on running report and clicking on the hyperlink, it redirects me well but in querystring i got Fields!INVOICE_NUMBER.Value, it doesnt get replaced by its value(database value which is int), which should be the Invoice number.
where I am going wrong..
Your field is being evaluated as a literal string. You need to write a function to generate the URL:
="http://localhost:64970/InvoiceManagement.aspx?a=" & Fields!INVOICE_NUMBER.Value
There should be a function box for URL target you can click in the properties dialog, or you could paste the function code in over your URL's text. Note: I'm using VS to manage my SSRS reports, and I'm unsure if these methods are the same for BIDS, if that's what you're using. The problem is the same either way, though.

Resources