7921 Posts in 1359 Topics by 933 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » ImageDataObjectManager. How to automatically insert the photo in the top of the list?
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 953 Views |
-
ImageDataObjectManager. How to automatically insert the photo in the top of the list?

28 January 2011 at 4:14am Last edited: 28 January 2011 9:02am
Hi
I haveclass Foto extends DataObject
...
and in my FotoPage$manager = new ImageDataObjectManager(
$this, // Controller
'Fotos', // Source name
'Foto', // Source class
'Attachment', // File name on DataObject
array(
'Name' => 'Name',
'Description' => 'Description'
//'Category' => 'Category'
), // Headings
'getCMSFields_forPopup' // Detail fields (function name or FieldSet object)
// Filter clause
// Sort clause
// Join clause
);
$f->addFieldToTab("Root.Content.Fotos",$manager);
in my _config.php
I setSortableDataObject::add_sortable_classes(array('Foto'));
How to rearrange photos? Now when I add a Foto, it ceases at the end of the list. How to make it automatically becomes the first?
http://www.webspilka.com.ua/temp/foto_.png
-
Re: ImageDataObjectManager. How to automatically insert the photo in the top of the list?

28 January 2011 at 9:46am
You can probably just do
SortableDataObject::set_sort_dir("DESC");
-
Re: ImageDataObjectManager. How to automatically insert the photo in the top of the list?

28 January 2011 at 10:38pm
Thanks
but SortableDataObject:: set_sort_dir ("DESC");
change the order of a site,
http://www.webspilka.com.ua/temp/foto_1.png
but the administrative part of it remained as before. How can I change the order for the admin part?
-
Re: ImageDataObjectManager. How to automatically insert the photo in the top of the list?

29 January 2011 at 8:39am
Right. The backend always reflects how the objects will be displayed on the frontend. Otherwise, it would be really confusing!
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com -
Re: ImageDataObjectManager. How to automatically insert the photo in the top of the list?

3 February 2011 at 3:35am
Please tell if I have two classes.
class Foto extends DataObject ...
class MiniThumbs extends DataObjectFor one (Foto) want to change the sorting site.
For the second (MiniThumbs) to leave as it was.SortableDataObject::Foto:: set_sort_dir ("DESC");
SortableDataObject::MiniThumbs:: set_sort_dir ("DESC");It can be done?
| 953 Views | ||
|
Page:
1
|
Go to Top |

