Results 1 to 9 of 9

Thread: Linking PDFs to Albums via Theme?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2006
    Location
    Posts
    304

    Default

    Charles

    Brilliant! This does just what I was looking for. I'll want to tweak it a bit to fit my display format, but it is an important addition to OCD. Thanks for your work.

    Added after working with the dax:

    I believe one could put any content in the field Condition, even just one letter, because all that the dax does is check whether it has content. I don't believe OCD is capable of acting on what the content actually is. That means that the part of the dax that refers to Condition could be modified to:

    <dax:if(condition)>
    <a href='<daxath/>\Notes.pdf'<dax:condition/></a>
    </dax:if>

    and whatever content the user would put into the field would be displayed instead of "Liner Notes". The file name does have to be Notes.pdf however (which means there's a lot of editing ahead of me).


    I would also note that if someone is already using Condition, there are other fields that could be used, such as Distributor (on the General tab), Location, Status, Borrower (all on the Library tab). Just substitute the name of that field for condition in Charles' dax.
    Last edited by Jazz_North; 05-25-2014 at 03:06 PM.

  2. #2

    Default A few more thoughts

    I agree that the IF condition can only test whether a field is empty or not. I tried to pull the content from the OrangeCD tag into a variable but was not successful. My plan was to then use a script to evaluate the content.

    You could edit the theme to make the file name something other than "Notes.PDF," but the restriction is that it has to be the same file name for all albums so that the link that the template displays on the album page works. Remember that if having the direct link is not important to you, you can put any PDF file (and multiple ones at that) into the album's media folder and open a file from the list after clicking on "View Files."

    The folder where OrangeCD is installed includes the "daxedit.exe" program, which can be used to edit themes. (You can also open the theme with any text editor to edit it, such as Notepad.) After starting daxedit, the right panel shows all of the tags (i.e., database fields) that are available, which is helpful to figure out how to refer to these tags in code.

  3. #3
    Join Date
    Oct 2006
    Location
    Posts
    304

    Default

    You can also create a custom field to use as the IF field if you don't want to use an existing OCD field such as Condition. You can also add Charles' dax to the track page if you want to access the liner notes from there also.

  4. #4
    Join Date
    Oct 2006
    Location
    Posts
    304

    Default

    I have found a little hitch in this. If the path has an apostrophe in it (as in C:\Albums\O'Farrill) then the dax won't work. This is different from the way Play and Queue work as they both allow an apostrophe in the path. I don't know enough to understand why this is the case.

  5. #5

    Default

    The forum replaces ": p" with a smiley icon, so in the below code, replace the icon with : p (no space between : and p).

    Replace
    <a href='<daxath/>'>View Files</a>
    and
    <a href='<daxath/>\Notes.pdf'><dax:condition/></a>

    with
    <a href="<daxath/>">View Files</a>
    and
    <a href="<daxath/>\Notes.pdf"><dax:condition/></a>

    and it will work with paths that include an apostrophe. Not sure why.
    Last edited by Charles_Litton; 05-27-2014 at 03:05 AM.

  6. #6
    Join Date
    Oct 2006
    Location
    Posts
    304

    Default

    Thanks, Charles. That works.

Posting Permissions

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