Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Blog post author not showing up by default and the dropdown is MASSIVE

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 2444 Views
  • Decisive Flow
    Avatar
    Community Member
    73 Posts

    Blog post author not showing up by default and the dropdown is MASSIVE Link to this post

    blogentry.php has:
    static $has_one = array(
          "Author" => "Member",
       );

    which I take to mean the author is the member who is signed in. - but the dropdown remains blank until you select an author. Should I remove the dropdown to have it assigned by default?

    Also...

    I think because we fiddled with the forms and now we have 180 newsletter signups, they all appear in the dropdown, but since they have no names, they are all commas - so even though they have no access to the cms, or admin rights, they are still showing up.

    On the flip side, we have three admin members, and only one shows up.

  • Decisive Flow
    Avatar
    Community Member
    73 Posts

    Re: Blog post author not showing up by default and the dropdown is MASSIVE Link to this post

    any updates on this?

    i am a registered administrator but my name doesnt show up ont he author list, yet all the newsletter signups who arent even authors are showing up...

    very weird!

  • Simon
    Avatar
    Core Development Team
    27 Posts

    Re: Blog post author not showing up by default and the dropdown is MASSIVE Link to this post

    The relationship you've specified below is simply a relationship between a page and a member. By default it won't use the currently logged in member as thats a pretty big security risk.

    However you can specify the default author to be the current member which would give you the functionality you required.

    to do this, define a static variable called $defaults. eg:

    static $defaults = array(
    "Author" => Member::CurrentMember()->ID,
    );

    Put a filter on the dropdown like by group when your making it in getCMSfields() in the CMS, that should solve your problems with the large drop down.

    2444 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.