We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50272
    • 89 Posts
    Hi Folks

    Wondering if anyone can put me on the right path here?
    I'm struggling to establish an efficient, functional workflow in setting up an mp3 library for a choir website.
    I have 600 mp3's that need to be available both in the browser and downloadable.
    This equates to 150 songs, each with four mp3 files representing the four voice types; 1st tenor, 2nd tenor, baritone, bass.
    My thinking thus far has me using an aggregate Migx TV (named 'mp3_migx') with four associated tv's (the four voice types).

    The Tpl ('mp3Tpl') is simply

    <li class="song">
        <h5>song title</h5>
        <div class="button-group voice-type">
          <a href="[[+mp3_download_1st_tenor]]" class="button">1st Tenor</a>
          <a href="[[+mp3_download_2nd_tenor]]" class="button">2nd Tenor</a>
          <a href="[[+mp3_download_baritone]]" class="button">Baritone</a>
          <a href="[[+mp3_download_bass]]" class="button">Bass</a>
        </div>
    </li>
    


    and the template call

    <ul>
        [[getImageList?
        &tvname=`mp3_migx`
        &tpl=`mp3Tpl`
        ]]
    </ul>
    


    I have added a New Content Type of 'mp3'.

    I have set up a dedicated Media Source with 'basePath' and 'baseUrl' pointing to the mp3 folder...
    and 'allowedFileTypes' set to 'mp3' only.

    I have set each tv to that same source.

    The idea is not only to be able to build the listings dynamically, but also for the files to then be available inline/downloadable.
    I thought the Input Option on the four associated tv's should be 'File' but unfortunately this fails to capture the path to the file.

    I've tried dozens of permutations and read widely.
    But before I go too far down the wrong path,
    does anyone have any experience of this kind of project?

    Any nuggets of gold would be appreciated...
    even gold dust...

    Thanks
    Chris



    My setup:
    MODX latest (2.5.7)
    MAMP (latest (3.0.7.3))
    PHP (5.5.26)
    MySQL (5.5.38)
    Chrome: Std and Canary (latest versions)
    MacOS Sierra 10.12.5
      • 4172
      • 5,888 Posts
      you don't need any TV, if it would be possible to have allways the same filenames.

      <li class="song">
          <h5>song title</h5>
          <div class="button-group voice-type">
            <a href="mp3/[[*id]]/1st_tenor.mp3" class="button">1st Tenor</a>
            <a href="mp3/[[*id]]/2nd_tenor.mp3" class="button">2nd Tenor</a>
            <a href="mp3/[[*id]]/baritone.mp3" class="button">Baritone</a>
            <a href="mp3/[[*id]]/bass.mp3" class="button">Bass</a>
          </div>
      </li>


      Then you just need one file-TV connnected to a mediasource with a dynamic path the current resource-id, where they can upload all 4 files.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 50272
        • 89 Posts
        Hi Bruno

        I'm not quite understanding your meaning.

        I have 150 different song titles, each with four variations.
        So yes the file names would differ.
        Or at least the song title itself would differ
        i.e.

        mp3/song-title-one-1st_tenor.mp3
        mp3/song-title-one-2nd_tenor.mp3
        mp3/song-title-one-baritone.mp3
        mp3/song-title-one-bass.mp3

        mp3/song-title-two-1st_tenor.mp3
        mp3/song-title-two-2nd_tenor.mp3
        mp3/song-title-two-baritone.mp3
        mp3/song-title-two-bass.mp3

        etc

        When you say "the current resource-id", should I be creating child resource/symlinks
        for every mp3 file and making the containing resource the parent (i.e. current resource),
        A bit like the TV Input Option, 'Resource List'?

        Please forgive my ignorance
        [ed. note: geordiechris last edited this post 9 years, 3 months ago.]
          • 17301
          • 932 Posts
          Will the page titles be the song titles? If so then it could still work with Brunos method with some slight alterations.

          So say we have a song called 'MODX is great'. If we input that title into our title field then the alias should be 'modx-is-great'. We then just need to organise all of the files for the songs into a folder structure that is /mp3/modx-is-great/modx-is-great-1st_tenor.mp3 and we can automate the links in modx with the following code:

          <li class="song">
              <h5>song title</h5>
              <div class="button-group voice-type">
                <a href="mp3/[[*alias]]/[[*alias]]-1st_tenor.mp3" class="button">1st Tenor</a>
                <a href="mp3/[[*alias]]/[[*alias]]-2nd_tenor.mp3" class="button">2nd Tenor</a>
                <a href="mp3/[[*alias]]/[[*alias]]-baritone.mp3" class="button">Baritone</a>
                <a href="mp3/[[*alias]]/[[*alias]]-bass.mp3" class="button">Bass</a>
              </div>
          </li>
            ■ email: [email protected] | ■ website: https://alienbuild.uk

            The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
            • 17301
            • 932 Posts
            Hi Chris,

            Not sure if you just replied and deleted or if its disappeared somehow? But If I understood your response correctly you may want to take a look at FileLister ( https://docs.modx.com/extras/revo/filelister ) which essentially grabs all the files in a directory and lists them out for you. You can edit the tpl files to output as you need.
              ■ email: [email protected] | ■ website: https://alienbuild.uk

              The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
              • 50272
              • 89 Posts
              Hi LK

              Will the page titles be the song titles?
              Well this is what I need to be clear on from the start really.

              No, the mp3 files only need to reside in a folder awaiting download/inline playing.
              There will be no need for a page per song, just a page (songs.html) displaying an alphabet selector
              and song matrix, that when a song is located and a voice type clicked, the appropriate mp3 file is triggered
              to be accessed by the user.
              Please see attachment...

              To be clear, this is purely for my benefit as I build the ul li matrix.
              I just thought a migxTV would be the ideal candidate...

              Appreciate your time

              ...apologies, not sure what is happening to the attachment...just gets lost!
                • 50272
                • 89 Posts
                Ah, just crossed.
                Yes I was/am having trouble getting my attachment through.
                But I will have a look at Filelister.
                Sounds promising.

                Thanks once again
                  • 17301
                  • 932 Posts
                  No problem. I think there is an ongoing issue with attachments on this forum at the moment. Hopefully FileLister does what you need know but if not then upload your attachment to imgur and just link it here.
                    ■ email: [email protected] | ■ website: https://alienbuild.uk

                    The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
                    • 50272
                    • 89 Posts
                    Very kind of you