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.

Data Model Questions /

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

Creating model connections via "New ModelName" in the grid


Go to End


2 Posts   1154 Views

Avatar
Admonish

Community Member, 3 Posts

25 February 2016 at 10:50pm

First off I want to apologize for the title, I just didn't know any other way to express something close to what I need in one line. Also please note that I have only used silverstripe for 2-3 weeks so I am rather new to the platform.Moving on. So I have a ModalAdmin called PackageAdmin that is for a custom Package Manger for a client. The PackageAdmin manages a 'Package' model (as well as others but they are not related to this post) which has a 'RecommendedPackages' $db array 'item' (not sure what the right name for them is). What the user would like to be able to do is select these recommended packages from the list of already existing packages. As I am new to silverstripe I am not quite sure what the best way of going about this would be.

Thanks in advance,
Admonish

P.s. it was 2:50am when i posted this so I am a bit tired

Avatar
martimiz

Forum Moderator, 1391 Posts

26 February 2016 at 9:37am

Edited: 26/02/2016 9:38am

I'm sure that I almost grasp what you're saying - but the bit about selecting recommended packages from existing ones possibly eludes me... Do you mean a filter to select only recommend packages instead of the whole lot? If RecommendedPackage = Boolean, you could just add the fieldname to the Package models $searchable-fields array, that would give you a dropdown that would let you do that...

If not - maybe you could post (an excerpt of) your Package model?

By the way, they're called DBFields or database fields :)