Copied to clipboard

Flag this post as spam?

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


  • adarsh 46 posts 66 karma points
    Jun 03, 2011 @ 12:01
    adarsh
    0

    Link to the PDF file stored in the media folder

    Hi every body.

    i stored a pdf file in media folder

    like

    media

      > document

          in document i am having pdf file..

    i need to link that file in home page..

    this is the xslt wht i written for that
    i used the media picked property and that is UploadPdf


    <xsl:value-of select="umbraco.library:GetMedia($currentPage/data[@alias='UploadPdf'], 0)/data [@alias = 'umbracoFile']"/>

    i dont wheater is correct or wrong..

    i got that stuff for umbraco.library..

     

    write iam using hard coded stufff..

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 05, 2011 @ 11:51
    Jan Skovgaard
    0

    Hi Ardash

    If you're having a property named "UploadPdf" on your document type at a first sight this syntax seems to be correct but perhaps the reason for it not showing anything is that it's the syntax for the legacy XML schema?

    What version of Umbraco are you using?

    /Jan

  • adarsh 46 posts 66 karma points
    Jun 06, 2011 @ 13:56
    adarsh
    0

    Hi Jan

    The version of Umbraco which iam using is 4.7

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 06, 2011 @ 19:09
    Jan Skovgaard
    0

    Hi adarsh

    Ok...then the reason why you don't get any output is probably because that the code you use is trying to match the old legacy schema used in older version of Umbraco before the release of 4.5.

    Try using this code instead

    <xsl:value-of select="umbraco.library:GetMedia($currentPage/UploadPdf, 0)/umbracoFile"/>

    If you have problems using other XSLT examples that might be matching the old schema you can benefit from using this XSLT converter tool done by Tommy Poulsen - http://blackpoint.dk/umbraco-workbench/tools/convert-xml-schema-to-45-.aspx

    Hope this helps.

    /Jan

  • adarsh 46 posts 66 karma points
    Jun 06, 2011 @ 20:43
    adarsh
    0

    Thanks for reply Jan

    i will try tommrow and if i have any doubts i will get back to you..

    Adarsh

  • adarsh 46 posts 66 karma points
    Jun 07, 2011 @ 12:35
    adarsh
    0

    Hi Jan.

    is just the one piece of code in need to write in XSLT or still i need to write more..

    i am getting an error..

    i tried all the option what are in the forum but no successfull..

     

    Thanks

    Adarsh

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 07, 2011 @ 21:54
    Jan Skovgaard
    0

    Hi Ardash

    What kind of error do you get?

    /Jan

  • adarsh 46 posts 66 karma points
    Jun 08, 2011 @ 10:20
    adarsh
    0

    Hi Jan

    The error which iam getting is

    Error parsing XSLT file: \xslt\Pdfdownload.xslt

    i just created the xslt and written this code.

    <xsl:value-of select="umbraco.library:GetMedia($currentPage/UploadPdf, 0)/umbracoFile"/>

    and placed this macro in my template..

    thats wht i did..

    Thanks

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 08, 2011 @ 21:25
    Jan Skovgaard
    0

    Hi Ardash

    Hmm, try doing this then...

    <xsl:variable name="pdf" select="umbraco.library:GetMedia($currentPage/UploadPdf, 0)" />

    <xsl:if test="$pdf">
           
    <xsl:value-of select="{$pdf/umbracoFile}" />
    </xsl:if>

    If that does not help then try adding this querystring to your url in the browser address bar: http://yoursite.local?umbdebugshowtrace=1

    This should give you a stack trace where you might get some information about what is going wrong by searching for a error description marked with red.

    Try to do this to see if it gives you any information back.

    Hope this helps.

    /Jan

  • adarsh 46 posts 66 karma points
    Jun 09, 2011 @ 16:54
    adarsh
    0

    hi jan

    <a>

      <a>
      <xsl:attribute name="href">    
         <xsl:value-of select="umbraco.library:GetMedia($currentPage/uploadPDF, 0)/umbracoFile"/>  
        </xsl:attribute>
       <xsl:attribute name="target">
        <xsl:value-of select="'_blank'" />
        </xsl:attribute>
      </a>

    This was i did and its works fine

    thanks for your help Jan/

    /Adarsh

    
    
                
  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 09, 2011 @ 18:59
    Jan Skovgaard
    0

    Hi Ardash

    You're welcome.

    Is there any difference in the extension call in the working example and the sample you posted previously? I'm a bit puzzled since these two lines seem to be identical...or maybe I'm turning blind :-)

    /Jan

  • adarsh 46 posts 66 karma points
    Jun 09, 2011 @ 19:22
    adarsh
    0

    hi Jan

    i dont no really, iam a begineer for xslt i just tried all the option and finally got the solution

    thanks for the support..

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 09, 2011 @ 19:25
    Jan Skovgaard
    0

    Hi Ardash

    No worries, was just wondering.

    You know where to ask if there is anything you have doubts about :-)

    Have a great day.

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft