Jump to:

23355 Posts in 17838 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » Passing a variable to getCMSFields_forPopup

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: 355 Views
  • lozhowlett
    Avatar
    Community Member
    144 Posts

    Passing a variable to getCMSFields_forPopup Link to this post

    Hi

    Is there anyway to pass a variable to getCMSFields_forPopup?

    $tablefield = new HasManyDataObjectManager(
    $this,
    'FixtureHomePlayers',
    'FixtureHomePlayer',
    array(
    'TeamPlayer.PlayerName' => 'Name',
    'TeamPlayer.PlayerPosition' => 'Position',
    'Tries' => 'Tries',
    'Goals' => 'Goals'
    ),
    'getCMSFields_forPopup(VARIABLE-NAME-HERE)',
    'Team.ID='.$this->HomeTeamID, //filter
    'TeamPlayer.PlayerName', //sort
    'LEFT JOIN TeamPlayer ON FixtureHomePlayer.TeamPlayerID=TeamPlayerID LEFT JOIN Team ON TeamPlayer.TeamID=Team.ID' //join

    );
    $fields->addFieldToTab("Root.Content.HomeTeam",$tablefield);

    But that does not work, I need to pass the HomeTeamID to the popup, so it only loads players for that team.

    Cheers

  • lozhowlett
    Avatar
    Community Member
    144 Posts

    Re: Passing a variable to getCMSFields_forPopup Link to this post

    *Bump*

  • swaiba
    Avatar
    Forum Moderator
    1784 Posts

    Re: Passing a variable to getCMSFields_forPopup Link to this post

    hmmm not a nice solution, but you *could* set a session variable (that is blanked on navigation away)

    that session variable could be read elsewhere... but this is guess I don't understand what you are trying to do

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