Hello, i have been having a few questions related to Silverstripe for a while and was looking for an answer to them so here goes.
- - What is the best way to change the image file name upon uploading? This has to be specific to only that one uploader (applies to frontend and backend).
- - What is the best way to extend the Image class adding a couple of fields to the file (in a separate table ). And selecting this class on the uploadfield. The problem right now is their is a getter located: http://api.silverstripe.org/3.1/source-class-File.html#_get_class_for_file_extension in the File DataObject class. Though this one only looks for extensions and the one in http://api.silverstripe.org/3.1/source-class-FileField.html#_saveInto only looks for has_one relations but not for has_many relations. So its impossible to extend an Image -> upload and image and have it save them with a has_many relation to the other DataObject.
- - Like i posted in the template forums: http://www.silverstripe.org/template-questions/show/58111 I am still looking for a way to restructure the template folder to have it more based on the url path so: http://website.com/team/backend/wedstrijd should correspond to folder: <mysite>/templates/team/backend/wedstrijd/
- - I have been having some trouble with the routing from time to time, eventually i always fix it but it has been bothering me quite a bit. Having to create multiple:
--- Name: myroutes After: framework/routes#coreroutes --- Director: rules:
Blocks in a specific order to get a path to work for example, i want the following rules to go to the correct controller:
- 1: 'team': 'TeamController'
- 2: 'team/$teamID': 'TeamSingleController'
- 3: 'team/$teamID/wedstrijd': 'TeamWedstrijdController'
The problem is team will go to the TeamSingleController or TeamWedstrijdController instead of the TeamController.
Changing the order also never really seems to have an effect but creating multiple routes configs with different names generally works.
- 1: 'team': 'TeamController'