17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1662 Views |
-
One page to many files relationship?

8 October 2007 at 3:02pm Last edited: 8 October 2007 3:02pm
I've got a site that currently has a one-to-one page-to-file relationship, created by adding this to my page.ss code; in the Page extends SiteTree...
static $has_one = array(
"Download" => "File",
);...and in function getCMSFields()...
$fields->addFieldToTab("Root.Content.Download", new FileIFrameField("Download"));
What I want to be able to do is to upload multiple files to the same page. I see some people have had success with one->many image relationships...
http://www.silverstripe.com/general-discussion/flat/5853
http://www.silverstripe.com/general-discussion/flat/1686Would a similar approach be feasible, using something like a hasmanycomplextablefield? Any suggestions, advice is welcome. Cheers.
-
Re: One page to many files relationship?

8 October 2007 at 5:37pm
I don't see why not.
The example in this post looks pretty much like what you're after:
http://www.silverstripe.com/general-discussion/flat/5853Could you not make a dropdown for each line item, which points to an asset in the system? Or, are you looking to have a file uploader for each item, so you upload the file on the spot?
Cheers,
Sean -
Re: One page to many files relationship?

8 October 2007 at 10:08pm
"Or, are you looking to have a file uploader for each item, so you upload the file on the spot?"
Yep, that one.
The FileIFrameField gives the exact functionality I require for a single file (ie. I can upload a new file to the system, or select an existing one from the filestore), I just need to duplicate that behaviour multiple times on the same page.
The way I envision it is that when you upload/add the first file, a second FileIFrameField appears upon the first file being attached to that page. ie. you've always got count(submitted FileIFrameFields)+1 on the admin page.
The last post by jam13 on the http://drupal.org/node/155743 thread does look like what I'm after - I just haven't implemented a HasManyComplexTableField before, so was wondering if it was going to do the job for me in this instance. One way to find out, I suppose...
-
Re: One page to many files relationship?

9 October 2007 at 11:52pm
I'd be interested if you come up with a good solution for this. I eventually abandoned it and went for a workaround solution because HasManyComplexTableField wasn't a very practical system for Images (or I imagine files).
-
Re: One page to many files relationship?

22 July 2008 at 8:35pm Last edited: 22 July 2008 8:53pm
>The way I envision it is that when you upload/add the first file, a second FileIFrameField
>appears upon the first file being attached to that page. ie. you've always got count(submitted
>FileIFrameFields)+1 on the admin page.That's just what I'm searching at the Moment. Hay anyone found the solution to that?
It would be greatly more User friendly if it could act that way.I got problems using the FileIFrameField on the HasManyComplexTableField realtion. The solution that was shown here: http://www.silverstripe.com/general-discussion/flat/5853
| 1662 Views | ||
|
Page:
1
|
Go to Top |




