I am having an issue that despite having all the files showing up with in the back end, I can't get them to render on the front end...
This is my code
class Download extends DataObject {
static $db = array(
'date' => 'Text',
'description' => 'Text'
);
static $has_one = array(
'TheDownload' => 'File'
);
static $belongs_many_many = array (
'Download' => 'Downloads'
);
function getCMSFields_forPopup() {
$fields = new FieldSet();
$fields->push(new TextField('date','Date Created'));
$fields->push(new TextField('description','Description of file'));
$fields->push(new FileIFrameField('TheDownload'));
return $fields;
}
class Downloads extends Page {
static $db = array(
);
static $has_one = array(
);
static $many_many = array(
'TheDownloads' => 'Download'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$manager = new FileDataObjectManager(
$this, // Controller
'TheDownloads', // Source name
'Download', // Source class
'TheDownload', // File name on DataObject
array(
'Date' => 'Date',
'Description' => 'Description',
), // Headings
'getCMSFields_forPopup' // Detail fields (function name or FieldSet object)
// Filter clause
// Sort clause
// Join clause
);
$fields->addFieldToTab("Root.Content.Resources",$manager);
return $fields;
}
<table class="downloads">
<tr>
<th>Date</th>
<th>Description</th>
<th>Size</th>
<th>Download</th>
</tr>
<% control TheDownloads %>
<tr>
<td>$Date</td>
<td>$Description</td>
<td>$TheDownload.Size</td>
<td><a href="$TheDownload.URL" target="_new"><img src="/themes/howell/images/icons/page_white_acrobat.png" alt="Download "/></a></td>
</tr>
<% end_control %>
</table>
Any ideas as to what I am doing? It just outputs the table headers and nothing else -> http://howellv2.stagedsite.net/committee-minutes/?flush=all