7938 Posts in 1466 Topics by 943 members
|Go to End||Next >|
23 June 2009 at 3:31am
The VideoPage_Item extends ComplexTableField_Item should not be there. Copy-Paste mistake. I palyed with it yesterday. this is nested code...
23 June 2009 at 4:40am Last edited: 23 June 2009 4:41am
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)
class VideoPage extends Page
class VideoPage_Controller extends Page_Controller
public function category()
// 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')) :
// redirect to global view
public function CategoryTitle()
return isset($this->urlParam['ID']) ? $this->urlParam['ID'] : "All categories";
<% 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!
23 June 2009 at 5:44am
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...
23 June 2009 at 10:03am
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.
24 June 2009 at 2:07am
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());
28 June 2009 at 9:50pm
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?
29 June 2009 at 1:22pm
NEVERMIND! 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...
29 June 2009 at 2:00pm Last edited: 29 June 2009 2:01pm
It's based on the upload_max_filesize value set in your php.ini.
|Go to Top||Next >|