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
Developer forum
E-mail notifications
current domain tag
Posted on 01/07/2010 17:54:19
Replies
Nicolai Høeg Pedersen
Posted on 02/07/2010 10:23:35
Hi Nuno
Could you please elaborate? I'm not sure I fully understand.
Could you please elaborate? I'm not sure I fully understand.
Posted on 02/07/2010 11:44:52
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&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
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&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