Uncle Cheese,
ooops...
The VideoPage_Item extends ComplexTableField_Item should not be there. Copy-Paste mistake. I palyed with it yesterday. this is nested code...
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
DataObjectManager Module /
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba
New Feature: Audio and Video
Oooh.. BC.. C'est beau la-bas.. Je cherche toujours une raison de pratiquer mon francais..
Okay, so try something like this (not guaranteed to be free of syntax errors)
VideoPage.php
class VideoPage extends Page
{
...
}
class VideoPage_Controller extends Page_Controller
{
public function category()
{
if(isset($this->urlParams['ID'])) {
// get videos with the name given in the ID param
$videos = $this->Videos("Category = '".$this->urlParams['ID']."'");
return $this->customise(array('Videos' => $videos))->renderWith(array('VideoPage','Page')) :
}
else
// redirect to global view
Director::redirect($this->Link());
}
public function CategoryTitle()
{
return isset($this->urlParam['ID']) ? $this->urlParam['ID'] : "All categories";
}
}
VideoPage.ss
$CategoryTitle
<% if Videos %>
Voici des videos...
<% control Videos %>
<% end_control %>
<% else %>
Il n'y a aucun de videos dans cette catégorie
<% end_if %>
Now just link to /my-video-page/category/some-category
The one issue I suspect you'll encounter is that the category name has to be URL-safe, e.g. no spaces or special characters. That's why it's helpful to create a Category object and have the Videos relate to that rather than a string, because you can specify the category ID rather than just a title.
Let me know how that goes!
Allô MonOncle Fromage,
P'tit train va loin.... (Québec expression meaning "we're getting there....")
Getting better... You are absolutely right about the category object....I will work on it now...
Tiguidou! (F_ _ _ k'n A) ... my fav slang expression I like to teach...
reSalut,
Looking good...
In this matter, I created 1 page per category and link to videos/category/CategoryName.
Further on, I created a CategoryPage (hidden). I wish I master enough SilverStripe and DataObject programming to feel confortable to use dynamic category instead. That will come...
I tried refering with the tutorials and posts related to db category with no success...
I thought I could have a dropdown list of dynamic categories with the video and have the user select right from the same page. Some kind of form need to be build. However, I do not know how to make that work to meet my need.
Any thought?
You need to create a separate interface for creating categories, say, on another tab in the page edit view. Then your video page has_one Category, and in the popup for the Video object, you have a dropdown menu for CategoryID
new DropdownField('CategoryID','Category', DataObject::get("Category")->toDropdownMap());
Hey UC :) I finally rebuilt my dev box and EVERYTHING is installed fresh from scratch (SS stable, DOM, SWFUpload both from SVN), also got the error logging sorted out. Here is the error I get when trying to create and AudioPage
28-Jun-2009 07:40:31] Error at cms/code/CMSMain.php line 392: getCMSFields returned null on a 'Page' object - it should return a FieldSet object. Perhaps you forgot to put a return statement at the end of your method?
NEVERMIND! :D Got some IRC support and that one's all sorted....
My next question iiiiiiiis - how do I un-limit the file size cap? It's capped at 2Mb or 3Mb at the moment...
It's based on the upload_max_filesize value set in your php.ini.