Jump to:

23481 Posts in 18965 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » ***SOLVED***Staff Section without individual pages?

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 2 3
Go to End
Author Topic: 1582 Views
  • ambient
    Avatar
    Community Member
    123 Posts

    ***SOLVED***Staff Section without individual pages? Link to this post

    Hi All,

    I'm building a staff section for a website.

    The thing is I only need a small amount of info for each staff member.

    Image
    Title
    Name
    Department
    Phone
    Email

    It seems excessive and unnecessary to have to create a new page for each member of staff when so little info is involved.

    Is there some other way of doing this where I can add a new staff member to the page without creating an extra page for each individual?

    Thanks for listening

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: ***SOLVED***Staff Section without individual pages? Link to this post

    I would agree an entire page is excessive, have you considered StaffPage has_many StaffMember. Where StaffMember is a DataObject, then the getCMSFields would need a tab with a hasmanycomplextablefield controling the relationship.

  • ambient
    Avatar
    Community Member
    123 Posts

    Re: ***SOLVED***Staff Section without individual pages? Link to this post

    Hi Swaiba,

    My silverstripe/php skills aren't the greatest. Are you talking about something like whats done in Tutorial 5 - Dataobject Relationship Management?

    I did play around with this a few months back when trying to do something else but ended up dropping it as I couldn't get the ImageField to work in the pop up. If you think that uploading images should work I'll try it again and let you know when/if I run into problems.

    Tutorial 5 - Dataobject Relationship Management seems to have a lot more than I'd need. Can you tell me which parts I should concentrate on.

    Cheers

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: ***SOLVED***Staff Section without individual pages? Link to this post

    My silverstripe/php skills aren't the greatest. Are you talking about something like whats done in Tutorial 5 - Dataobject Relationship Management?

    Yes this Project(Page) has_many Student is exactly what I am talking about.

    Check this also for more information... http://doc.silverstripe.org/sapphire/en/topics/datamodel
    If you have any issues specifically with the tutorial, then please post them as "Issue with tutorial 5" and hopefully they can be solved.

  • ambient
    Avatar
    Community Member
    123 Posts

    Re: ***SOLVED***Staff Section without individual pages? Link to this post

    Okay, I'm making progress now and have it almost working.

    The only issue now is When I go to add a new member the pop up won't allow me to choose an image until I have first saved the other details like name, email etc.

    Instead of the image upload box I get:
    Images can be attached once you have saved the record for the first time.

    So I have to save the member, close the pop up, and then edit member to re open the pop up and add the picture.

    I have found that it is to do with the DataObject needing an ID before it can create the relation with the image and the ID?

    Any ideas on how I can solve this issue?

  • zenmonkey
    Avatar
    Community Member
    528 Posts

    Re: ***SOLVED***Staff Section without individual pages? Link to this post

    Unfortunately, that's normal. Using the DataObjectManager Module will at least let you save the DataObject without closing the popup. Other than you'd need to overload the pop-up and create a new method that would cache the image and create all the data objects sequence since as you guessed you can't associate the image object with the staff dataobject until the staff object as been saved and received an ID

    I've toyed with the idea using onAfterWrite and checking for an unset ImageID field to prevent it from running each time the dataobject is saved. Its messy but possible. I've done it with the bulkCSVUploader, but never with a front end form

  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: ***SOLVED***Staff Section without individual pages? Link to this post

    You could use Uploadify, which will allow you to upload images before a DataObject is created for the first time. Uploadify holds the image information in temporary space/memory until the object is created, then it adds the file relationship.

  • zenmonkey
    Avatar
    Community Member
    528 Posts

    Re: ***SOLVED***Staff Section without individual pages? Link to this post

    Good to know, UncleCheese hadn't released that module last time I was playing with that kind of functionality. May have to upgrade some sites

    1582 Views
Page: 1 2 3
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.