I have a template that I’ve been building for an Express_Entry_List block. It pulls data from an Express Object and it’s Entries, plus associated Express Entries from other Express Objects. For the sake of explanation, the Express Entry List lists Tournaments for an event, and the associated Express Objects include which Game the Tournament is for, so we can show the Name of the Game, the Game’s graphical banner, and stuff like that. I have that working rather well, looks pretty tasty, and I’m using the magnific-popup css/js package for tasty pop-ups (although I still need to clean up the code and not do in-line, but I digress).
Part of outstanding (as in, incomplete) functionality that I need to figure out, is participant registration for each tournament, and that needs to be possible in 3x different ways, as an individual, creating/joining a team, and creatining/joining a roster for more permanent teams (another term is used that I won’t go into here).
Now, I’m pretty sure I can bang out a solution for joining as an individual, just a link that programmatically creates an Express Entry based on the logged in user, which Express Entry the List block is rendering, and stuff like that.
The part that I am trying to figure out, and documentation is falling short on me, is the Team Create/Join aspects… specifically Create (as I have an idea on the Join aspect).
What I’m hoping to do is have each Express Entry in the List block (each Tournament is displayed separately from the next as each is a different Entry), have a link the user clicks/taps on, it pops-up (magnific-popup) and in there is a short form, “Team Name” and a “submit” equivalent button. Standard stuff I’m sure (although embedding one block in another I am still not sure how much I need to achieve that).
However, what I want is that Form to have a field that is hidden to the user, which gets pre-filled by which Tournament the Form is for (based on which Entry the user clicked/tapped on).
I found this method to partly get me the way there… : html - PHP TextBox Value Before Submission - Stack Overflow
Whereby I stuff the Tournament Express Entry into a variable $whichTournament (or whatever, the name doesn’t matter) and modify the value of that field in the form in similar vein as…
value="<?php echo $whichTournament->getAttribute('attribute_handle'); ?>"
Naturally customising it to the actual value I want, I’m just showing for historic/explanation purposes.
The issue I’m having is I really don’t know how to declare which field in the form to apply this to, and I also need to modify that same field probably to:
I also want to apply themeing/styling to it, but I suspect that is likely handled by the template that is already defining/rendering the “parent” Express Entry List block.
So… I hope this makes sense, but can I get some help with some explicit code examples that I can modify to make this work? I’m trying to build a really good User eXperience here, and this last bit I can’t wrap my head around (modifying just the one Form field, and how to declare it, etc).