I've been going over tons of posts and the data model documentation. Maybe I am just blind for the obvious by now but I only find options, that retrieve ALL columns from data objects (which would equal SELECT * in SQL). What I need is to get only the data from one specific column that matches the criteria (SELECT Filename FROM ... WHERE ParentID=85). Neither the filter nor sort options will provide this as far as I can tell. Here is my set-up:
I have a list of images saved to a specific folder with a fixed ID. I need to pass the "Filenames" dynamically as an array to a customScript in the init(); within the Page_Controller. If I would need to access this on the template, I'd do:
function GetImages(){
return DataObject::get("Image", "ParentID = 85");
}
and call the method in the template but limit it to the wanted data:
<% control GetImages %>
$Filename
<% end_control %>
How do I get only the data from the column "Filename" into an array, that I then can use in my customScript also within the init() of the controller:
Requirements::customScript("
jQuery(document).ready(function(){
$.backstretch([
"file1.jpg", "file2.jpg", "file3.jpg" //THIS IS WERE THE ARRAY WOULD GO
], {
fade: 750,
duration: 4000
});
});
");
Thankful for any hint!
Sam