Jump to:

5513 Posts in 1732 Topics by 1218 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Advice needed

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1404 Views
  • Tonupbandit
    Avatar
    Community Member
    7 Posts

    Advice needed Link to this post

    I'm working up a site for an audio producer who would like a few pages that she can offer some audio samples on. Ideally she'd like to be able to display the content like so:

    Title of piece
    Short Description
    Thumbnail image
    xspf player

    Being more a designer than developer, not sure how I'd achieve this in the CMS so that she can add these herself. At first I thought a widget might work, but I'm not sure. In a perfect world, I'd like to see a widget that she could enter text into the fields that need it, attach a thumbnail, and attach an mp3 that is linked to the player. I say widget because she's going to have to be adding multiple instances of these on individual pages. But maybe I'm missing something.

    Any suggestions, advice, anything? Thanks much.

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Advice needed Link to this post

    Hi Tonupbandit

    I think what you are looking for is a complextablefield so that you can add as many audio 'objects' as you want. So it might look something like this:

    mysite/code/AudioItem.php

    mysite/code/AudioPage.php

    Then finally in the template Layout/AudioPage.ss, you would have something like this:

    <% control AudioItems %>

    $Title
    $Description
    $Thumbnail
    <a href="$AudioFile.URL" >Download Audio File</a>

    <% end_control %>

    Of course you might e using a player of somesort in which case you can just put the $AudioFile.URL in the appropriate place

    For more info on the different types of relationships you can have in SS check out tutorial 4.

  • Tonupbandit
    Avatar
    Community Member
    7 Posts

    Re: Advice needed Link to this post

    Thanks Aram! This looks like it should do exactly what we're hoping for. Will play around with it tonight and let you all now how it works out. Thanks again.

  • GustyPolo
    Avatar
    Community Member
    9 Posts

    Re: Advice needed Link to this post

    Hey Aram,

    I recently began using silverstripe, so being a designer I mostly piece together things I need to get stuff done here. I came across your code for adding mp3 files with descriptions and stuff and it seems like the perfect solution for what I need. I'm trying to create sermon download section for my church website. I've prepared the files like you have them but I"m having trouble. The AudioItem.php file is good, I get no errors when I run a dev/build. But once I get to the AudioPage.php and run a dev/build it stops half way. I tried my best to figure out where there could be something wrong but I have no clue. Would you or anyone reading this post be able to help me?

    Thanks

  • Taffy
    Avatar
    Community Member
    119 Posts

    Re: Advice needed Link to this post

    Hi Gusty, you might want to look @ Unclecheese's DataObjectManager module. http://silverstripe.org/dataobjectmanager-module/

    Here is a video of him adding adding an mp3 using the module http://www.youtube.com/watch?v=239nAqxizjA

    1404 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.