Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7083391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:10:19+00:00 2026-05-28T07:10:19+00:00

I am doing a Umbraco site (my first) and I am having a serious

  • 0

I am doing a Umbraco site (my first) and I am having a serious issue with loading an image on one of my pages.

I created a new template and one section of the code I inserted the following:

<a href="{umbraco.library:NiceUrl($currentPage/../@id)}">"
<xsl:value-of select="$currentPage/../@nodeName" />
</a>

When I look at the results in the browser it displays the results exactly the same, it does not get executed before rendering. ie I see this when I look at the “view source” in the browser:

<a href="{umbraco.library:NiceUrl($currentPage/../@id)}">
<xsl:value-of select="$currentPage/../@nodeName" />
</a>

The confusing part is that when I run the following :

<img src='<umbraco:Item field="articlePhoto" runat="server"></umbraco:Item>' />

It actually generates this tag :

<img src="~/media/554/bath.png">

The main thing I am trying to do is load a dynamic field/url into an image tag.

Any help would be greatly appreciated.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:10:20+00:00Added an answer on May 28, 2026 at 7:10 am

    I’m assuming you actually have two problems here and that they’re not linked.

    First Problem: Code not executing

    You are trying to execute XSLT code directly inside the template. The template only accepts what you would normally find in a ASPX page (e.g. HTML, Server Controls, Registered Umbraco Controls etc) and will not parse any XSLT constructs but output them directly into the source, as exemplified in your question.

    You will need to create an XSLT file in the developer section, along with it’s associated macro, which is usually created automatically along with the XSLT. Then you simply import the macro into the template.

    Template Snippet:

    <umbraco:Macro Alias="MyMacro" runat="server" />
    

    XSLT Snippet:

    <a href="{umbraco.library:NiceUrl($currentPage/../@id)}">
        <xsl:value-of select="$currentPage/../@nodeName" />
    </a>
    

    Second Problem: Image not showing

    It’s weird Umbraco is preprending the ~ symbol as your code is indeed correct (it’s working on my Umbraco – Version 4.7.1). As a work-around, try creating an XSLT file and using the following XSLT code. At least with XSLT you’re able to put in coding logic, which will be needed as your pages become more complex.

    XSLT Snippet:

    <xsl:if test="$currentPage/articlePhoto != ''">
        <img src="{$currentPage/articlePhoto}" />
    </xsl:if>
    

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Doing this in a console program: object x = new string(new char[0]); If one
Doing my first SL4 MVVM RIA based application and i ran into the following
Doing the below will reproduce my problem: New WPF Project Add ListView Name the
Doing my first tryouts with foreign keys in a mySQL database and are trying
I'm new to Umbraco and I like it so far, I understand how it
Doing a RichFaces/jsf project in a new job, haven't been doing it long. The
I have the following XSLT macro (in Umbraco) <xsl:param name=currentPage/> <xsl:template match=/> <xsl:apply-templates select=$currentPage/imageList/multi-url-picker
doing the first Project Euler question: summing the multiples of 3 and 5 between
Still trying to get the navigation control of a new site working the way
Doing a project in win32 in c++, attempting to double buffer the image being

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.