The Hickensian

How to setup a Textpattern playlist

There was once a time when my most-asked-question was “can you send me the Firefox logo vector originals please”. Nowadays, it’s “How did you do the playlist bit – is it a plugin?”. So to save repeating myself, I’m writing this up as a blog post.

First of all, I’m afraid it isn’t a plugin. While there are ways of using the Amazon API to pull out album cover images automatically, I’ve had mixed results. Sometimes its wrong, and sometimes it doesn’t stock the album., which as an anal cover fetishist, just isn’t acceptable.

So, before I go further, bear in mind that with Textpattern, you can add anything, and send to anywhere, and display it how you like it. While not completely automated, my system does at least allow me to update the playlist fairly quickly.

Here are the steps if you want to try to setting one up yourself:

  1. Create a new custom field called “Amazon URL”. This is used to store the link (My own setup is slightly different as it uses the ASIN instead)
  2. Create a new section called ‘Playlist’. Turn all the radio button options to ‘no’. This will give us a specific section to post to.
  3. Create an ‘article’ form called ‘covers’, and add the following:
    <li><a href="<txp:custom_field name="Amazon URL" />" title="<txp:title />">
          <txp:article_image />
    </a></li>
  4. In your page template, where you want the playlist to appear, add the following:
    <ul>
    <txp:article_custom form="covers" limit="9" section="playlist" sortby="Posted" sortdir="desc" />
    </ul>
    The article_custom tag is the key here. It isn’t context-sensitive like <txp:article /> and allows you to output content from a different section anywhere you like.

    Then I add the content. So being the aforementioned anal cover fetishist, I upload these manually via Content > Images. I then take a mental note of the image ID, go to the write tab, and enter this number in the ‘article image’ field.

    Then all that needs to be done is add the Title, and choose the correct section. Done!

Comments | RSS

No.1

Thame said 840 days ago:

Yup yup, I love me some Textpattern. Is this not just the greatest CMS on the planet!

No.2

Jeremy Koempel said 840 days ago:

Yay! Thank you for sharing Mr. Hicks. I too emailed you on the subject. Great textpattern tip.

No.3

Guillermo said 840 days ago:

Hey, thanks for the idea. I was trying to use Last.fm and Amazon’s API to automate the whole thing, but I wasn’t happy with the results either.

By the way, the playlist RSS feed’s items link to a blank page which keeps reloading forever.

No.4

Joey said 840 days ago:

Thanks John, so simple with textpattern. I love it.

No.5

Johan said 840 days ago:

Which musiczines or radio progs you listen to Jon Hicks or audience blogue extra ordinairis

No.6

dotone said 840 days ago:

Nice usage of Custom Field, me dig!

No.7

macsepp said 839 days ago:

I still use the iTunesWatcher for that task. It just gets the Covers from Amazon of the Songs I play in iTunes. Too bad the developer chose to quit working on it.

No.8

cpk said 839 days ago:

Hi Jon,

I too am a big fan of TxP and like your simple solution to showing playlists on various pages using article_custom. However, since you had to create a section for this to work, I assumed that you would be redirected to a 404 page if you attempted to go to your /playlist section page or at least a single page devoted to playlist info but instead you get a page that repeatedly wants to refresh but with no content. Didn’t know if you were aware of that and that it might cause you problems if that page gets indexed by the search engines.

No.9

Respiro, the logo designer said 838 days ago:

John, as I understand, your playlist is only a recommendation, right? I mean… the songs can’t be listened.

No.10

MrQwest said 838 days ago:

Jon, thanks for the post. I too wondered how to do the playlist thing, and like others, had looked at the amazon API or RSS feeds to pull in the content, but it just wouldn’t work!

Txp surely is a powerful CMS!

No.11

Mearso said 837 days ago:

Cheers Jon

Thanks for this – I’ve already implemented it. One tip I’ve got when finding the album covers is to use iTunes. Ctrl Clicking on the Album artwork panel gives you the option to copy the artwork.

It’s a doddle to save from Photoshop as the right size.

I found it easier than trawling amazon and editing their versions of the artwork.

No.12

Andy Yeates said 836 days ago:

Thanks Jon,

Now you’ve explained it all seems so simple.

Cheers.
Andy

No.13

Rob said 835 days ago:

Sorry, I can’t resist. You have a fetish for anal covers?

Thanks though for the look at your back-end code.

No.14

akatsuki said 827 days ago:

Ah, and yet the beauty of automation is lost. I used to use the Artify module of iTunesWatcher, but I hate running the Applescript all the time. I just wish there was a way to interface it directly with Last.fm…

No.15

Paula F said 826 days ago:

Great tut, thanks! Also, thanks for the source code. ;) Paula

No.16

Christopher Webb said 826 days ago:

I’m sure that I’ve followed these instructions just as you’ve outlined above, but I can’t seem to get the albums to display correctly. Could someone please help? I’m having a heck of a time here. Any help would do!

No.17

Jon Hicks said 826 days ago:

@Christopher – looking at your site, its seems to be working! Whats the problem exactly?

Elsewhere

The Rissington Podcast - weekly shenanigans with Jon Oxton Hicksmade - unique handmade goods by Leigh Hicks

Hickr | RSS