Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Creating a video / audio page

Go to End

9 Posts   19349 Views


Community Member, 4 Posts

18 October 2009 at 7:10pm

I am a Newbie with Silverstripe - so far I am very impressed with the modular design and the ease of site construction. I am developing a website for my church.

I am currently running this effort on my laptop (WAMPsever) and I have successfully install many of the modules and widgets that I need. But I am not sure what would be the correct module for posting a list of either audio or video files for the end user to download.

I plan to post a list of church services (both audio and video) for download. What is the best way to setup such a page in SS? What module do I use? Thanks.


Community Member, 215 Posts

18 October 2009 at 7:57pm

Hi there, Welcome to SS.

I have recently done a similar thing with my churches website(still in development), we have the weekly sermons recorded (audio only) and posted to the site

I used the dataobjectmanager module which has built in support for Mp3's where you can do something similar to:

<% control Messages %>$Player<% end_control %>

To include the flash player on your site.

I created a dataobject for each message where the title and speaker etc are entered and the mp3 uploaded and these are managed in a FileDataObjectManager within a message page.

If you haven't run through the tutorials then they are always the best place to start and if you want to have a look at the code for the page I mentioned above let me know and I'll post it.

Hope it goes well


Community Member, 4 Posts

19 October 2009 at 6:41pm

Thanks for the info. I will try the DataObjectManager a try.

I looked at your church website that you provided - very nice and clean. Now I have additional questions

- Did you create your own theme template or modify an existing theme?

- What module did you use on your home page for the flash photo gallery? I like the slow zoom / pan effect.

I am putting this for our church - which is also Baptist (Southeast Baptist Tabernacle, Indianapolis, IN). Thanks so much for you time and help. I will go over the tutorial again and again - I am a slow learner.

-Rick Smith


Community Member, 25 Posts

29 October 2009 at 1:50pm

Edited: 29/10/2009 1:51pm

if you want to have a look at the code for the page I mentioned above let me know and I'll post it

May I look to your code for this pages? Thanks.

Terry Apodaca

Community Member, 112 Posts

30 October 2009 at 9:04am

I would love to know how you put your page together for the sermons...and if you used a module to list each message and have the pagination also.

I was thinking about using the calendar module and modify that so that the client can just load new messages right from the cms...i

I'd like to know how you did it...if you don't mind.


Community Member, 215 Posts

31 October 2009 at 6:01pm

Hey guys,

Sorry for the delay, I forgot to subscribe to this thread so didn't see your questions. Firstly:
Did you create your own theme template or modify an existing theme?
- No theme for that site just created it from scratch.
What module did you use on your home page for the flash photo gallery?
- That's not a module that's actually done in flash then just displayed as a .swf, I'm planning on redoing it in javascript but not a huge priority.

As to the more general questions about how I did it I won't post my actual code as it gets kinda tricky with the ajax, RSS and speaker selection but I'll post some code which will achieve the same effect but without the ajax, RSS and speaker dropdown menu.

I didn't use a module for the frontend, the objects are managed with the DataObjectManager module, this includes the flash player I put in the table. I am planning to post a couple of tutorials covering what all this means on the website but I've got exams this week so it'll have to wait sorry. But basically it consists of two php files, Message.php and MessagePage.php, then a template file.

This has pagination built into it but there is a good step by step of what that part of the code means here

If you have any questions just ask (I'll subscribe this time) but otherwise this should pretty much just work :)




class Message extends DataObject
	static $db = array (
		'Title' => 'Varchar',
		'Speaker' => 'Varchar',
		'Date' => 'Date',
		'Duration' => 'Varchar'
	static $has_one = array (
		'Attachment' => 'File',
		'MessagePage' => 'MessagePage'


	public function getCMSFields_forPopup()
		return new FieldSet(
			new TextField('Title'),
			new TextField('Speaker'),
			new TextField('Duration','Duration: (MM:SS)'),
			new DatePickerField('Date'),
			new FileIFrameField('Attachment')
	function Link(){
		return $this->Attachment()->Filename;



class MessagePage extends Page {
	static $has_many = array (
		'Messages' => 'Message'
	static $icon = 'mysite/images/icons/messages';
	public function getCMSFields()
		$f = parent::getCMSFields();
		$manager = new FileDataObjectManager(
			$this, // Controller
			'Message', // Source class
			'Attachment', // File name on DataObject
				'Title' => 'Title',
				'Speaker' => 'Speaker'
			), // Headings 
			'getCMSFields_forPopup' // Detail fields (function name or FieldSet object)
			// Filter clause
			// Sort clause
			// Join clause

		$f->addFieldToTab("Root.Content.Messages", $manager);
		return $f;

class MessagePage_Controller extends Page_Controller {

	function orderedMessages(){
		// Change this to set the limit of messages displayed on each page //
		$messageLimit = 10;
		if(!isset($_GET['start']) || !is_numeric($_GET['start']) || (int)$_GET['start'] < 1) $_GET['start'] = 0;
		$SQL_start = (int)$_GET['start'];
		$doSet = DataObject::get(
			$callerClass = "Message",
			$filter = "MessagePageID = $this->ID",
			$sort = "Date DESC",
			$join = "",
			$limit = "{$SQL_start},$messageLimit"
  	return $doSet ? $doSet : false;



<!-- Main right column -->
		<table id="messages">
		<% control orderedMessages %>
			<tr class="$EvenOdd $FirstLast">
				<td class="message-date">$Date.Nice</td>
				<td class="message-title">$Title<br />$Speaker <% if Duration %><span class="duration">($Duration mins)</span><% end_if %></td>
				<% control Attachment %>
					<td class="message-download"><a href="$Link">Download</a></td>
					<td class="message-playnow">Play now:</td>
					<td class="message-player">$Player</td>
				<% end_control %>
		<% end_control %>
		<% if orderedMessages.MoreThanOnePage %>
			<p id="pagination-links">
				<% if orderedMessages.NotFirstPage %>
					<a href="$orderedMessages.PrevLink" class="ajax" title="Previous Page">&lt;&lt; Prev</a> | 
				<% end_if %>
				<% control orderedMessages.Pages %>
					<% if CurrentBool %>
					<% else %>
						<a href="$Link" class="ajax" title="Go to page $PageNum">$PageNum</a> 
					<% end_if %>
				<% end_control %>
				<% if orderedMessages.NotLastPage %>
					| <a href="$orderedMessages.NextLink" class="ajax" title="Next Page">Next &gt;&gt;</a>
				<% end_if %>

		<% end_if %>
		<!-- end Middle column -->


Community Member, 4 Posts

10 November 2009 at 11:00am

Thanks for the additional information (it will take me a few days to digest all this). I look foward to reading your tutorial on

Again, thanks for the help.



Community Member, 9 Posts

12 December 2009 at 8:51am


the website of the church looks good.

I always making a site of our church and want to place also our recordings on these site.

But i've copied your code into the right files/folders.

But when i goto the CMS i see a Messagepage to make, when i make this page, i got an error

it says:

"There has been an error". Nice error i think... :)

So i think its in the file "messagepage.php", but i can't find it.

Maybe you have a solution?

GreetX DreeZy


I try to type some english, but it is not very good i know.

Go to Top