You can write an httpmodule to parse your output for you. Then you should be able to hook into the output after umbraco has rendered the niceurl stuff.
* Page1 > add hostname www.domain.com/page1 without the aspx
* Page2 > add hostname www.domain.com/page2 without the aspx
Now your niceurl will work and give you an absolute url because it will search for the domain names up to level 2. I have this working on our installation using umbraco 4 and we are trying to change the method that causes this behavior wich is niceurldo in the library.
This is really a bug in Umbraco.
thx, Len.
For my part the structure is /en/newsletter/...aspx
So I have define my hostname on www.domain.com/en and then on www.domain.com/en/newsletter
Full url on href src for newsletter template (2)
Hello
I have made a newsletter template. I use the generated html from umbraco and then I copy/pasted it to a newsletter software.
I am looking for a way to transform on the fly all relatives urls (in freetext editor) to an absolute one (withhttp://www...)
It's possible to override the render and execute some RegEx or replace like this but it removes the nice url transformation.
<script runat="server">
protected override void Render(HtmlTextWriter writer)
{
System.Text.StringBuilder htmlString = new StringBuilder(); // this will hold the string
System.IO.StringWriter stringWriter = new System.IO.StringWriter(htmlString);
System.Web.UI.HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
base.Render(htmlWriter);
htmlWriter.Flush();
writer.Write(ReplaceUrl(stringWriter.ToString()));
}
private string ReplaceUrl(string p)
{
string url = "http://www.gondwana-dmcs.net";
return p.Replace("href=\"/", "href=\""+url+"/");
}
</script>
This solution from Dan removes as well the friendly url system:
Do you have an idea to have all absolute url everywhere without using a custom xslt on each page properties ?
Thanks for your input,
MrFLo
I just always use this:
<xsl:variable name="urlPrefix"> <xsl:text>http://</xsl:text>; <xsl:value-of select="umbraco.library:RequestServerVariables('HTTP_HOST')" /> </xsl:variable>And the links (including niceURL get built like this:
You can write an httpmodule to parse your output for you. Then you should be able to hook into the output after umbraco has rendered the niceurl stuff.
It should work, but this is quiet a complex solution and it will reduce performance and it'll be applied on all the site.
There is not a way to do it in tinyMCE?
I am not the only one looking for this and still no solution for all that messages:
http://our.umbraco.org/forum/using/ui-questions/4843-Editor-removing-external-link-when-its-the-same-as-the-domain
http://our.umbraco.org/forum/using/ui-questions/7697-Cannon-enter-full-URL-in-text-in-tinyMCE
If you know more thanks for your help!
This solution from Len seems to work in tinyMCE but you need to do this on each parent node...
Hi,
This is an issue that I have been checking and I think it is a bug in Umbraco.
You can set the option <useDomainPrefixes>true</useDomainPrefixes> in the config file umbracosettings.config
to true. Then you have to add the domain name/hostname to all pages on level 2, like this:
Homepage > add hostname www.domain.com
* Page1 > add hostname www.domain.com/page1 without the aspx
* Page2 > add hostname www.domain.com/page2 without the aspx
Now your niceurl will work and give you an absolute url because it will search for the domain names up to level 2. I have this working on our installation using umbraco 4 and we are trying to change the method that causes this behavior wich is niceurldo in the library.
This is really a bug in Umbraco.
thx, Len.
For my part the structure is /en/newsletter/...aspx
So I have define my hostname on www.domain.com/en and then on www.domain.com/en/newsletter
Hope this help
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.