But I wouldn't know how to achieve the same result with what's being created by your javascript. The only level we need grouped here is Session where he set this up for date, session, round and game number, and it would use the wpcf-session field, not wpcf-session2 because this view is showing Teams not Matches.
We are preparing for the next tournament on this site. That tournament will happen on June 24th. So I will have a whole different set of teams and matches that I'll enter into the system in the leadup to that tournament and then I'll add all the match scores after June 24th. Once those are set up, I'll try to figure out the best way to account for different tournaments in the structure of everything that is already working (Teams, Schedule, Results). If we get that working for different tournaments, the same approach could be used for different years as well.
There is no rush to have this all working before this June 24th tournament. We're just using the real life team and match information to provide the testing environment to account for all needs with this. Whenever this is all operational, I'll then add it to the site on pages accessible through the top menu, but there is no pressure as to when it all actually works. This is just something I'm trying to get if it can be done because I see the potential to market this functionality to leagues like this anywhere in the world. I decided to see how much of this Toolset would be able to accomplish, but I knew the Standings functionality was going to be the most difficult to achieve and would push Toolset capabilities. Sorry that this is proving this difficult to achieve everything and sorry there are so many details to keep straight and account for with this. This specific league's scoring/standings approach is probably as complex as any sports league would ever be. So this is actually good to see if it can be done with this, while being more difficult. If it can be done with this, I think it can be done for any other sport much more easily.
Hello,
I have checked the your website setting again, there is a custom taxonomy "Tournaments" registered to both post types:
hidden link
- Teams
- Matches
And the custom field "wpcf-session" is in post type "Teams"
hidden link
Yes, it is possible to group the results by above "tournament" taxonomy and "session" field.
In order to upload the "tablesorter" JS/CSS files into your website, please provide website FTP access of your website in below private message box, I can setup a demo for you. Private message box enabled.
Thanks for the details, I am checking it in your website, will update here if find anything
I have setup a demo in your website:
1) Upload tablesorter CSS/JS files in your website theme folder:
hidden link
hidden link
2) Create a new post view "Teams posts by session":
hidden link
- Query "Teams" posts,
- Filter by:
Select items with field:
Session is a string equal to VIEW_PARAM(session)
- In view's loop, display only three columns:
a) Team
b) Total Points
c) Wins
d) Losses
3) Create a new page "Teams List by session":
hidden link
display :
- First hidden post view
- Custom JS codes
<script src="
<em><u>hidden link</u></em>
"></script>
<link href="
<em><u>hidden link</u></em>
" rel="stylesheet">
<script>
jQuery( document ).ready(function($) {
$('.total-score').each(function( index ) {
var teamID = $(this).attr('team-id');
var totalScore = 0;
$( ".score-" + teamID ).each( function(){
totalScore += parseFloat($(this).text());
});
$(this).text(totalScore);
});
$('.total-win').each(function( index ) {
var teamID = $(this).attr('team-id');
var totalWin = $( ".Win.result-" + teamID ).length;
$(this).text(totalWin);
});
$('.total-loss').each(function( index ) {
var teamID = $(this).attr('team-id');
var totalLoss = $( ".Loss.result-" + teamID ).length;
$(this).text(totalLoss);
});
//tablesorter
$(function() {
$(".tablesorter").tablesorter({ sortList: [[1,1], [2,1]] });
});
});
</script>
- above post view's shortcode with session attributes:
<h3>Morning - 2.5</h3>
[wpv-view name="teams-posts-by-session" session="Morning - 2.5"]
<h3>Morning - 3.0</h3>
[wpv-view name="teams-posts-by-session" session="Morning - 3.0"]
<h3>Morning - 3.5</h3>
[wpv-view name="teams-posts-by-session" session="Morning - 3.5"]
<h3>Morning - 4.0+</h3>
[wpv-view name="teams-posts-by-session" session="Morning - 4.0+"]
<h3>Afternoon - 2.5</h3>
[wpv-view name="teams-posts-by-session" session="Afternoon - 2.5"]
<h3>Afternoon - 3.0</h3>
[wpv-view name="teams-posts-by-session" session="Afternoon - 3.0"]
<h3>Afternoon - 3.5</h3>
[wpv-view name="teams-posts-by-session" session="Afternoon - 3.5"]
<h3>Afternoon - 4.0+</h3>
[wpv-view name="teams-posts-by-session" session="Afternoon - 4.0+"]
Test it in frontend:
hidden link
It works fine, you can customize as what you want.
This looks PERFECT! There's are some total points that are slightly off from the spreadsheet, but I'm guessing those problems are on our end, not with the math of what you've provided. Let me go through each team methodically to determine the reasons for the discrepancies before I mark this ticket as resolved, but it is highly likely that this is it.
I changed the page name to Standings by Session and changed the URL to
hidden link
I eliminated the 2.5 session options here because we didn't use those.
We're on shaky ground here though because of my lack of javascript skills. I hope that I'll be able to figure out duplicating this on additional league sites or to tweak this to account for minor structural changes that might be made from tournament to tournament on this site without having to bother you for more help.
But this does display exactly what I was going for here, so HUGE THANKS as always for your incredible generosity with this assistance. The plan when I get to a point of comfort with this is to sell website packages to other leagues, and we'll have them all as Toolset customers for you. If I'm able to emulate this easily on other sites, then hopefully we'll be able to get you lots of customers that won't require this level of support.
I have marked this thread as "Waiting for feedback status", you can update here if you still need assistance for it.