7921 Posts in 1359 Topics by 933 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Preview: DataObjectManager module
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 54684 Views |
-
Re: Preview: DataObjectManager module

31 March 2009 at 10:06pm
Hi Howard,
"Sort clause" means column and sort direction. So you have to select a column. i.e
...
'', // Filter clause
'Date DESC', // Sort clause
''// Join clause
...But protected function loadSort() {...} in DataObjectManager.php overrides this value to null. So you have to remove this line
protected function loadSort() {
if($this->ShowAll())
$this->setPageSize(999);if($this->Sortable() && (!isset($_REQUEST['ctf'][$this->Name()]['sort']) || $_REQUEST['ctf'][$this->Name()]['sort'] == "SortOrder")) {
$this->sort = "SortOrder";
$this->sourceSort = "SortOrder ASC";
}
elseif(isset($_REQUEST['ctf'][$this->Name()]['sort']))
$this->sourceSort = $_REQUEST['ctf'][$this->Name()]['sort'] . " " . $this->sort_dir;else
$this->sourceSort = null;
} -
Re: Preview: DataObjectManager module

1 April 2009 at 2:30am
Shouldn't have to make that change in the latest version.
-
Re: Preview: DataObjectManager module

1 April 2009 at 10:03am
Hi,
I'm running revision 103 of DataObjectManager against revision 73881 of trunk. When I click the "save" button on the "add" pop-up window, the object I'm trying to add never gets saved to the database. Instead, I get sent to some kind of page that has an add link and a search box, etc.
The "add" pop-up window's form tag is as follows:
<form id="DataObjectManager_Popup_AddForm" action="admin/EditForm/field/Articles?ctf[Articles][per_page]=10&ctf[Articles][showall]=0&ctf[Articles][sort]=Created&ctf[Articles][sort_dir]=DESC&ctf[Articles][search]=&ctf[Articles][filter]=" method="post" enctype="application/x-www-form-urlencoded">Is that the correct action? It looks funny to me.
Thanks,
Ben -
Re: Preview: DataObjectManager module

1 April 2009 at 10:08am
That's the right link. Can you post a screenshot? Some code?
-
Re: Preview: DataObjectManager module

1 April 2009 at 10:14am
Thanks for the fast response! Image (which appears after I click save) & code attached.
Ben
-
Re: Preview: DataObjectManager module

1 April 2009 at 10:26am
Now that I take a closer look, that is the wrong form action. It should be admin/EditForm/field/Article/AddForm?ctf....
Hmm....
-
Re: Preview: DataObjectManager module

1 April 2009 at 12:13pm
Thanks for the wonderful module!
I am relative noob to SilverStripe (but not PHP and object oriented coding), and was wondering if anyone would like to share some tips and/or code on utilizing the DataObjectManager into the front-end templates? I would like to create a gallery, organized by category, and I have it all working from the CMS, but am pretty directionless for the next step.
Thanks in advance!
| 54684 Views | ||
| Go to Top | Next > |

Thanks hu
