Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

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.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

HasManyFileManager: New CMS module/extension. Testers/review needed


Go to End


62 Posts   109893 Views

Avatar
bummzack

Community Member, 904 Posts

13 October 2008 at 9:32pm

@Tyndie
No, currently there is no way to set the base folder in your Page class. It is hardcoded in the AttachedFile.php.
Instead of creating subfolders, you could just change your grouping? Something like:
Season-2008-2009_PDF
Season-2008-2009_Images
etc.

I noted the customizable folder thing as a feature request for a later release...

Avatar
erwanpia

Community Member, 63 Posts

14 October 2008 at 3:59am

Hello it's me again . Found why extra variables were not working on the front end : I was actually having a conflict with the gallery module, that also has a dataobjectdecorator for the File object. Removing the DataObject::add_extension( 'File', 'GalleryFile' ); from /gallery/_config solved the issue but doesn't tell me how to use both extension on Silvesrtripe . I suppose we'd have to share the decorator ... I also wonder why the decorator instruction from mysite was used in the HasManyFileManager ... Anyway FileManager is much better than gallery for displaying image thumbnails isn't it ?

Avatar
bummzack

Community Member, 904 Posts

14 October 2008 at 4:29am

Hi erwanpia

Ouch, bad news! Thanks for figuring that out (i placed it as a "known issue" in the README and i'll update the Documentation).
I'll install the Gallery Module on my local machine and try to find a solution. Maybe you could decorate the galleries decorator with the FileManager decorator (eg. DataObject::add_extension( 'GalleryFile', 'YourCustomFile' );) ? As far as i remember the Decorator Pattern, that should work actually...

On the other hand there's probably not a lot of people who will use both modules on one Site, since they can do similar stuff.
The good thing about the gallery is, that it already has frontend functionality (using Lightwindow). When using the HasManyFileManager, you are basically on your own when it comes to the appearance and functionality of your gallery. Some may like that (i do), others don't ;)

Avatar
erwanpia

Community Member, 63 Posts

14 October 2008 at 6:04am

Edited: 14/10/2008 7:49am

Hi that gives me some idea : I a mtryuing to customize the type of gallery being showed

I have added a dropdown field in your FilePage :

static $db = array("CustomTheme" => "Varchar");
...
$options = array("SimpleGallery"=>"SimpleGallery", "SlideGallery" =>"SlideGallery"); 
$fields->addFieldToTab("Root.Content.Main", 
new DropdownField("CustomTheme", "CustomTheme", $options)); 

and I try to use the controller to change the Layout (Layout/SimpleGallery.ss or Layout/SlideGallery.ss) WHILE KEEPING the main theme

[edit] this solution seems to work here :

class FilePage_Controller extends Page_Controller {
	function index() {
	$custom = $this->customise(array(
			"Content" => $this->customise(  )->renderWith($this->CustomTheme)
		));
		
		return $custom->renderWith('Page');
	  }

	
}

Avatar
bummzack

Community Member, 904 Posts

14 October 2008 at 7:59am

That's pretty cool actually! This could really be useful for some sites, never thought of that.
Maybe you should post that to the recipes Section in the wiki so that it doesn't get lost :)

Avatar
AndiAndi

Community Member, 2 Posts

14 October 2008 at 8:13am

I try to use this module outside of the CMS. Has anyone done that before? I thought I would use it for the blog module so that blog users could make posts with several media files without touching/logging into the SS cms. I find this module very interesting, and if I were able to use it for my front as well, it would be marvelous.

Avatar
bummzack

Community Member, 904 Posts

14 October 2008 at 8:31am

@AndiAndi
I never tried that. I guess you'd have to change several things in order for it to work. I'm not really experienced with this kind of frontend stuff using SilverStripe. For now, i added it to my list of feature-requests.

Avatar
Laax

Community Member, 14 Posts

20 October 2008 at 2:19pm

Hi banal,
this module is exactly what i was looking for since i began on SS. I do lots of slideshows and until now i used to have an imagepage class for each image so i could have the reordering drag n drop.
But i fell on a pb adding an ImageField with a custom File class. I need to have a custom thumbnail for each image/file. When creating a file in the CMS, it says I can upload the thumbnail once the entry is saved, but even saved, I still can't..

Hope you will figure out what happening there. (screenshot attached)
Thx