Inline xslt to get root node of multi-language web site.
I have setup multi-language web site for the Runway module.
The problem is that the Home Page in "Runway Master" is set to <a href="/">....</a> which will not work if the current node is under the second Language Content Node.
So I decided to use my knowledge to find the root language node of the current node using in-line XSLT.
If you're using domains then the "/" href would work perfectly.
If you are using top level nodes for your sites then you'd want to do something exactly like what you've done, that's a great solution.
To make the code shorter (but no more functional) you might add a new property on the homepage docType for 'siteUrl' and use a recursive umbraco:Item just like you did for the 'siteName'.
But... since the result of this xslt is not going to change you would get a slight performance benefit by making an xslt macro for the entire <a> tag and then cache the macro with a large cache time. Be sure to set the check box for caching the macro by page since the output is different depending on which page of the site you're on.
I'd make a short macro simply for the performance gain of caching the macro, but it isn't a big deal for such a simple macro so it is more in the category of optimization than necessity.
Inline xslt to get root node of multi-language web site.
I have setup multi-language web site for the Runway module.
The problem is that the Home Page in "Runway Master" is set to <a href="/">....</a> which will not work if the current node is under the second Language Content Node.
So I decided to use my knowledge to find the root language node of the current node using in-line XSLT.
This is what I did:
The great thing is that it is working !
But it looks a bit complicated.
Do you have a better approach ?
Tarek.
If you're using domains then the "/" href would work perfectly.
If you are using top level nodes for your sites then you'd want to do something exactly like what you've done, that's a great solution.
To make the code shorter (but no more functional) you might add a new property on the homepage docType for 'siteUrl' and use a recursive umbraco:Item just like you did for the 'siteName'.
But... since the result of this xslt is not going to change you would get a slight performance benefit by making an xslt macro for the entire <a> tag and then cache the macro with a large cache time. Be sure to set the check box for caching the macro by page since the output is different depending on which page of the site you're on.
I'd make a short macro simply for the performance gain of caching the macro, but it isn't a big deal for such a simple macro so it is more in the category of optimization than necessity.
cheers,
doug.
is working on a reply...