Developer forum

Forum » Feature requests » current domain tag

current domain tag


Reply
Hi,

Sometimes we need to manipulate links but Dw tags are always relative, except if you place some in <a> tags.

If we could have a global tag with the current domain, we would be able to send absolute links without the use of javascript

Best Regards,
Nuno

Replies

 
Nicolai Høeg Pedersen
Reply
Hi Nuno

Could you please elaborate? I'm not sure I fully understand.
 
Reply
Hi Nicolai,

Quite recently we had a client that wanted the newslist with links to Blogger, Facebook and Twitter in each newslist item. Using either html or xslt, I never get the absolute path only relative ones.

When working with simple href attributes, that's no problem, but when we need to build a specific href, sending Dw's full URL as a parameter, we need to use javascript to get the protocol and hostname. Example:

<a href="http://www.facebook.com/sharer.php?u=http://abreu.dev.dynamicweb.pt/Default.aspx?ID=1&PID=7&M=NewsV2&Action=1&NewsId=54&amp;t=MESÃO FRIO>Share in Facebook</a>

to achieve this I have to create Dw's URL like this:
URL = window.location.protocol + "//" + window.location.hostname + "< !--@News:Href-- >"

Having a domain tag would make it easy to create such links and prevent javascript usage (though I know sometimes you still need to use escape() for the javascript content).

example tag: DwDomain = "http://engage.dynamicweb-cms.com/"

Nuno