• Resolved synthesiamaniac

    (@synthesiamaniac)


    Adam,

    I created a table on my website using the following code and it seems to be working great!

    [MMFileList folder=test_files format=table type=midi removeextension=true]<td>{name}</td><td><a href="{url}"><img src=https://static.thenounproject.com/png/377196-200.png width=30 height=30></a></td>[/MMFileList]

    However, I want to add one more piece to it. Some of these MIDI files have PDF files associated with them. Same filename but a PDF extension.

    If there is a PDF file with the same name as the MIDI file (minus the extension), I’d like to show a second download link next to the first.

    How would I be able to do that?

    Thank you.

Viewing 1 replies (of 1 total)
  • Plugin Author Adam Bissonnette

    (@mmanifesto)

    I think you could maybe use the custom template functionality to put a list in your list. So you could list the midi files in one and then the template could have a list filtered specifically to your list of PDFs and regex matches to the related file – filenames would have to be similar which it sounds like they are.

    This is entirely hypothetical though – I’m not sure if it would work and it would probably take more resources to render – you’ll want good caching on your site ??

    I’m pretty sure this shortcode support sub-shortcodes so the solution could look something like this:

    [MMFileList folder="/cats/" removeextension="1" types="midi" format="li"]{name}.midi ({size})<br />
    [MMFileList folder="/cats/pdfs/" types="pdf" format="li"regexfilter="/{name}/" regexfilterinclusive="1"]{name} ({size})[/MMFileList][/MMFileList]

    This could create an infinite loop if done wrong so you might have to disable the plugin to undo any mistakes.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding Different File Types to Same Row of Table’ is closed to new replies.