Hi all,
I am using an image inside my navigation, so currently my xslt looks like this:
[code]
[/code]
However using a static image like this gets into problems when i go into a page inside a folder - obviously then the image url is incorrect. So how can i fix this? I tried adding an asp image control but it tells me asp is not defined so im not sure how to define asp in the xslt script or even if it is the right solution! Any ideas would be really appreciated!
Thanks in advance for your time!
If you start the src attribute with a slash '/', then it starts looking for the image from the root, no matter what page is requested. It will always start looking at the root of the web.
It's not limited to src attribute of img's, it does so for href attributes on a tags.
Btw: this is not umbraco, this is just plain vanilla web stuff. It's just how those things work.
Wow - I had no idea!
Thanks heaps dirk. Maybe in 5 years time i might be able to return that favour and answer one of your questions (if you ever have any!)
Regards,
Dale
Include an asp.net image in XSLT Navigation
Hi all,
I am using an image inside my navigation, so currently my xslt looks like this:
[code]
[/code]
However using a static image like this gets into problems when i go into a page inside a folder - obviously then the image url is incorrect. So how can i fix this? I tried adding an asp image control but it tells me asp is not defined so im not sure how to define asp in the xslt script or even if it is the right solution! Any ideas would be really appreciated!
Thanks in advance for your time!
Dale
Hi Dale,
Replace
[code][/code]
with
[code][/code]
Or did I misunderstand the question?
Regards,
/Dirk
Hi Dirk,
and thanks again. For some reason that fixes it, but i cant understand how it works the same for http://localhost/welcome.aspx and say: http://localhost/Articles/2009/ArticleList.aspx
because the image link in the latter page would be pointing to : http://localhost/Articles/2009/images/Key-trans.png wouldn't it?
Thanks and sorry for any ignorance on my belhalf if its something very simple - ive only "umbracoded" for 2 weeks now!
Hi dalecam,
If you start the src attribute with a slash '/', then it starts looking for the image from the root, no matter what page is requested. It will always start looking at the root of the web.
It's not limited to src attribute of img's, it does so for href attributes on a tags.
Btw: this is not umbraco, this is just plain vanilla web stuff. It's just how those things work.
Regards,
/Dirk
Wow - I had no idea!
Thanks heaps dirk. Maybe in 5 years time i might be able to return that favour and answer one of your questions (if you ever have any!)
Regards,
Dale
is working on a reply...