Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I am new to Umbraco so please excuse me as I am going to ask a very basic question.
I have installed the latest 6.0.3 Umbraco with the business template and the umedia templates.
I need to make an image link to an internal webpage.
Could someone show me some code on how this is done in an anchor tag and also xslt
I already know that the image will be uploaded using the Upload Type
But what do I use to allow the user to link to an existing page on the website and show that link and also make an image click to the page.
Thanks!
Hey Bob,
You can either use the Upload Control or the media picker, then also on your DocType create a property called imageLink of type Content Picker.
You then use these two values to display an image and a link however you like, via XSLT or Razor
Rich
Hi rich,
Thanks for your quick response.
I have done what you have said and have decided to use the following code staright into the template to create a dynamic link
Image...
This works and sends the user to the selected page http://listerivf.whclpreview.com/1107 but it shows an id in the url, is there any way I can get the page name to show in the URL i.e http://listerivf.whclpreview.com/egg-donors.aspx
Yes, you need to use NiceUrl instead of jsut the ID, I can't see your code, I think it got messed up by the editor.
Hi Rich,
Apologies, the code looks like this -
<a href="<%= umbraco.presentation.nodeFactory.Node.GetCurrent().GetProperty("imageLink").Value %>"> <umbraco:Image runat="server" field="au1" width="302" height="215" class="thumbnail" /></a>
Got it!
<a href='<umbraco:Item runat="server" field="imageLink" xslt="umbraco.library:NiceUrl({0})" />' >More info</a>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Making an Image link to a local page
Hi,
I am new to Umbraco so please excuse me as I am going to ask a very basic question.
I have installed the latest 6.0.3 Umbraco with the business template and the umedia templates.
I need to make an image link to an internal webpage.
Could someone show me some code on how this is done in an anchor tag and also xslt
I already know that the image will be uploaded using the Upload Type
But what do I use to allow the user to link to an existing page on the website and show that link and also make an image click to the page.
Thanks!
Hey Bob,
You can either use the Upload Control or the media picker, then also on your DocType create a property called imageLink of type Content Picker.
You then use these two values to display an image and a link however you like, via XSLT or Razor
Rich
Hi rich,
Thanks for your quick response.
I have done what you have said and have decided to use the following code staright into the template to create a dynamic link
Image...
This works and sends the user to the selected page http://listerivf.whclpreview.com/1107 but it shows an id in the url, is there any way I can get the page name to show in the URL i.e http://listerivf.whclpreview.com/egg-donors.aspx
Thanks!
Hey Bob,
Yes, you need to use NiceUrl instead of jsut the ID, I can't see your code, I think it got messed up by the editor.
Rich
Hi Rich,
Apologies, the code looks like this -
Got it!
<a href='<umbraco:Item runat="server" field="imageLink" xslt="umbraco.library:NiceUrl({0})" />' >More info</a>
Thanks!
is working on a reply...