We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45034
    • 8 Posts
    I am using code from the website "http://www.cmslesstraveled.com".

    I have 2 chunks:
    1. pdflink chunk:
    [[!getResources?&resources=&$alias+`[[+ids]]`&tpl=`pdflink.tpl`&includeTVs=`1`&includeContent=`1`]]

    2. pdflink.tpl chunk:
    <div class="pdflink" title="[[+introtext]]">
    <a href="[[~[[+id]]]]" target="_blank">[[+pagetitle]]</a>
    (<img src="manager/templates/foundation/images/style/acrobat.png" class="icon" alt="pdf icon" />
    PDF, [[+tv.docpages]] pages - [[filesize?&file=`[[+content]]`]])
    </div>

    I have my pdf file setup as a static resource with id = 102.

    I call the chunk:
    [[$pdflink?&ids=`102`]]

    The static resource file is in a nested directory.

    folder static docs (95)
    sub folder under static doc: policies (100)
    static resource: entertainment policies (102)
    The web page renders correctly showing the pdf icon, document name, # of pages, doc size. When I click on the policy link it opens a new tab correctly but displays blank. It picks up the file name correctly but it does not get the path where the file is located.

    It works when I am logged into the manager and test it. When I log out of the manager and test, it does not work.

    I have tried this in Firefox and Google Chrome. This is similar to Bug #313 "Download of Static Resource with application/pdf ContentType not working" from about 3 years ago.

    Is there a better way of doing this?