Developer forum

Forum » CMS - Standard features » Item field Link type returning bad url

Item field Link type returning bad url

Jonas Mersholm
Reply

Hi there,

We have a paragraph with an item, this item contains a field with the "link" type.

When fetching the value in the paragraph template using the following code: @GetValue("Item.Link")

an url with this format is written: "/Default.aspx?ID=xxxxxx"

Instead of the url format specified for the solution: "/pagename/pagename"

Any ideas or insights?


Replies

 
Nicolai Pedersen
Reply

Hi Jonas

Dynamicweb always returns the Default.aspx?ID=123 url - then when the html is send, the link is replaced with the friendly version. But only if the "Use customized urls" setting has been applied:

http://doc.dynamicweb.com/documentation-9/platform/advanced-settings/web-and-http#3514.

You should also set the "Forward to link (301 Moved Permanently)" setting.

If you use the link in other contexts that a <a href=""> it will not get replaced - so if you do <a href=''> (single quotes) or use it in js: location = 'Default.aspx?ID=123' it is also not replaced. Until the link is clicked that is.

BR Nicolai

 

You must be logged in to post in the forum