Jump to:

22979 Posts in 11808 Topics by 2827 members

General Questions

SilverStripe Forums » General Questions » how do I add attributes to a many-many relationship?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 383 Views
  • johnofjack
    Avatar
    Community Member
    22 Posts

    how do I add attributes to a many-many relationship? Link to this post

    I have a many-many relationship between BookPage and AuthorPage. That's working well enough--I can add authors to books; books appear on author pages; authors are listed on their book pages.

    I need to add an attribute to some of the authorships, but not to the authors themselves (someone might be the author of one book, the editor of another, the illustrator of a third).

    Authors are coming in on a checklist in the CMS when looking at a BookPage. What I'd like is to have a dropdown menu beside each one where you'd select the role each author played.

    I tried adding Roles to the Authors tab on BookPage, but couldn't get it to show up by each author; instead it showed up once at the bottom.

    I'm probably going about this wrong. What is the best way to do this?

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: how do I add attributes to a many-many relationship? Link to this post

    Hi John,

    Welcome to the forums,

    I've never done this, but you might want to search and read around "many_many_extraFields" this seems to be to do with what you are asking.

    Barry

  • johnofjack
    Avatar
    Community Member
    22 Posts

    Re: how do I add attributes to a many-many relationship? Link to this post

    Thanks, swaiba. I'll look into that some more; right now I'm having a bit of trouble wrapping my head around it, so I've moved onto other things. That *does* look like it could do what I need, though.

    383 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.