Results 1 to 9 of 9

Thread: Linking PDFs to Albums via Theme?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3

    Cool Found a Way to Link to PDFs and Other File Types

    I have figured out a way to link to PDF files (and other types of files) in OrangeCD. To make it happen, insert the attached code into your theme file, probably "Default V6.dax" located in "C:\OrangeCD\Templates", in the "::album/ui" section and before the following existing line (or anywhere else in the album section of the template):
    <div class="section" id="lineup">

    It works as follows.

    (1) If media files are linked to an album, OrangeCD stores the path to the album's media folder in the tag called "path." This new code checks if that tag is populated. If it is not, nothing happens. (If you do not have media files linked to an album, you could theoretically use a custom field and manually type in a path and use the tag where that path is stored to link to external files. I wrote this for my own use and so am relying on the media folder.)

    (2) If the path tag is populated, the code shows a new section entitled "External Files" on the album page, with a link entitled "View Files." Clicking that link shows all of the files in the album's media folder. You can then double-click on a file to open it. You could store a PDF file (or any other type of file) in the media folder and open it from here.

    (3) I also wanted to open PDF liner notes from the album page directly without intermediate steps. If I have PDF liner notes, I save them in the album's media folder under the file name "Notes.PDF" and then enter "Liner Notes" in the "Condition" tag (found on the "Album Properties | Library" tab in OrangeCD). The code checks if the condition tag is not empty. If it is not empty (regardless of how it is populated), the code displays a link pointing to the "Notes.PDF" file located in the album's media folder. Clicking the link opens the PDF file. If the PDF file is not in the media folder, the link opens a "page not found" page. (I linked the display of the direct link to the PDF to the Condition tag because I use it to identify albums that have PDF files, but you could use any field, such as a custom field, for this purpose or eliminate the reliance on a populated field entirely to always show the link.)

    Enjoy!
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •