Hi guys! I’m using ACF PRO for trying to create a tournament system to run gaming competitions. I’m only a lamen at best with coding, though I can logically understand more than I write (I usually get by with copy/paste + common sense). Below is my very rough outline of how I see the back end for my tournament system, and I’m looking for a bit of advice on how to get it done with ACF PRO (please).
So far I have added customer roles of ‘player’ and ‘tournament-admin’ to wordpress, as well as a ‘Tournaments’ option screen with children of ‘Add Tournament’ and ‘Add Player’, I’ve then used ACF to put a bunch of input fields on these screens as appropriate. From here I’m really looking for advice on the following:
– Based of what I’m trying to accomplish, is ACF the right tool for the job?
– What’s your recommended best way forward from where I’m upto (e.g. do I start on the front end, or polish the backend, etc)
– Can you link me to some articles on how to get the front end outputting the information I’ve entered in the backend?
– Is it possible (if so, how) to create a new data set (e.g. ‘Teams’) and then have ACF conditionally look for that data set if an option is selected?
I think that’s it for now until I have some direction to move forward. Here’s my ‘spec’
Tournament Name (select from existing to populate the below)
Add New (tournament name* (cannot be a duplicate))
Admins (select multiple from registered users with tournament-admin role)
Players (select multiple)
Add player (nick* (cannot be a duplicate), name, age, email, favourite game, avatar, config)
Has teams? (expand accordion to add team names and assign players)
Add team (team name*, members*, manager, captain*)
Add players (select multiple from added players)
Tournament Type (round robin, bracket)
If bracket – How many lives? (e.g. 2 = double elimination)
If bracket generate bracket based on players/teams (note: this seems like the really tricky bit)
Game (drop down, select multiple option, if multiple then show ‘assign games to rounds’)
Add game (game name*, genre, logo)
Assign Games To Round (select game per round)
Rules (free form or add ruleset)
Add ruleset (name*, free form block*)
Prize (free form text)
Front end/back end mode for private or public display (back end is WP admin, front end duplicates it to a page utilising theme etc)
Menu: Set Draw (bracket only)
Manual > Assign player/team to bracket position
Auto > Randomly assigned player/team to bracket position
Options per matchup
Enter score (each team/player to have scored entered)
Button: Submit score
Enter location (text field)
Enter social details (twitch/youtube/discord/etc)
If I’m understanding correctly, you are putting this all on an options page. This is probably the wrong way to do this.
As I see it, you should have multiple custom post types https://codex.wordpress.org/Function_Reference/register_post_type, this is a good tool for adding post types https://wordpress.org/plugins/custom-post-type-ui/
I would add the following post types
There may be others, but that’s where I’d start.
I probably can’t give you a lot of advice from there, the documentation here on showing content on the front end is good and includes everything you need. WP has documentation on creating custom templates for these post types. What you’re building is a pretty complicated system and it would take a lot to explain all the details of how I’d go from there.
Yes, I would use ACF for storing the custom data for each post type, but I would not use ACF to build the parts, this is something that should be done using custom post types and maybe custom taxonomies. Then you can use relationship fields, and post object field to built the relationships between the parts.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!