Thanks for This!
We'll try that out and let you know here about our succsess!
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.
- Previous 10 entries
- 1
- Page 22(current)
hi,
I had the same problem with my custom "Record-Page" (extends Page) and no access to my Methods that are defined in Record_Controller.
I saw this Entry: http://www.silverstripe.org/general-questions/show/262016
so I add the Contoller manually to the DataObject.
function getFilterRecords() {
$recordSet = DataObject::get("Record", "`SiteTree`.`ParentID` = '".$this->ID."'$additionalFilter");
if (!$recordSet || !$recordSet->exists()) return false;
// add controller
foreach ($recordSet as $record) {
$record->controller = ModelAsController::controller_for($record);
}
return $recordSet;
}
In Template:
<% if FilterRecords %>
<% control FilterRecords %>
<h1>$Title</h1> <!-- access via http://doc.silverstripe.org/built-in-page-controls#titles_and_cms_defined_options -->
<p>$controller.MyControllerMethod</p><!-- access via the record_controller -->
<% end_control %>
<% end_if %>
I hope this could help too.
Jörn
- Previous 10 entries
- 1
- Page 22(current)