Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rob 43 posts 79 karma points
    Nov 23, 2012 @ 20:41
    Rob
    0

    Problem with RequestServerVariables('HTTP_HOST')"

    When I add this call to my xslt it cause the xslt to throw an error. (I don't even need to reference the variable)

    <xsl:varaible name='siteurl' select="umbraco.library:RequestServerVariables('HTTP_HOST')" />

    Any ideas?

    Currently i have "hard coded" the base url into my xslt file, but that requires changing the value if the site is deployed to a differnt site (or an error if i forget).

    Is there a better method of extracting the URL in xslt?

    TIA

    Rob

  • Rob 43 posts 79 karma points
    Nov 23, 2012 @ 20:50
    Rob
    0

    Oh yeah.. I am aware of prettyurl, but suspect it can't be used here as the url i am trying to build includes a file uploaded with the document via an upload datatype.

    My understanding or prettyurl is that it requires the id of the resource it is building a url for and i dont think the uploaded file has an id i can reference. (please correct me if i am wrong)

     

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Nov 24, 2012 @ 02:05
    Lee Kelleher
    0

    Hi Rob,

    Not sure what the issue is, as your syntax looks correct.

    Try adding "?umbDebugShowTrace=true" to your page's URL - make sure that you're Web.config's appSetting "umbracoDebugMode" is set to "true" ... then scroll down until you find any error messages (should be in red text).

    Let us know what you find - it might be fixable.

    Cheers, Lee.

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Nov 24, 2012 @ 15:26
    Chriztian Steinmeier
    0

    Hi Rob,

    I'm just going to point out that there's a typo in the name of the <xsl:variable> tag (look close) - just to be sure that that's not the issue :-)

    Other than that - are you trying to link to a file, or is it a little bit different? If you're not doing any QueryString manipulations, I don't see why it shouldn't be possible to combine NiceUrl() and maybe a call to GetMedia() for it (but I obviously don't know your exact use-case yet).

    /Chriztian

  • Rob 43 posts 79 karma points
    Nov 24, 2012 @ 16:09
    Rob
    0

    Thanks guys..

    Chriztian.. Great spot. Yep.. naming a variable varaible sure does make things break and Lee. Thanks for the debugging tip! - that is something i know i will be able to use in the future.

    Rob

Please Sign in or register to post replies

Write your reply to:

Draft