Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author LaMonte Forthun

    (@lamontef)

    Grab the code below and save it to a file called teams-Compact.php or whatever you want to call it, changing ‘Compact’, but using the format teams-XXX.php. Then save that file to the template folder in the LeagueManager folder on your server. When you want to use it, your shortcode will look like this:

    [teams league_id=2 template=Compact]

    If you don’t like the space between the right side columns, you can change the width, I set them to 10%, they might be a bit too wide for your taste. The templates give you unlimited possibilities for how you can present your leagues…

    <?php
    /**
    Template page for Team List
    
    The following variables are usable:
    
    	$league league object
    	$teams: all teams of league
    
    	You can check the content of a variable when you insert the tag <?php var_dump($variable) ?>
    */
    ?>
    
    <?php if (isset($_GET['team_id'])) : ?>
    	<?php leaguemanager_team($_GET['team_id']); ?>
    <?php else : ?>
    
    <?php if ( $teams ) : ?>
    
    <table class="leaguemanager teamslist" summary="" title="<?php _e( 'Teams', 'leaguemanager' ) ?>">
    <thead>
    <tr>
    	<th width="70%" style="text-align: left;"><?php _e( 'Team', 'leaguemanager' ) ?></th>
    	<th width="10%" style="text-align: center;"><?php echo _c( 'W|Won', 'leaguemanager' ) ?></th>
    	<th width="10%" style="text-align: center;"><?php echo _c( 'T|Tie', 'leaguemanager' ) ?></th>
    	<th width="10%" style="text-align: center;"><?php echo _c( 'L|Lost', 'leaguemanager' ) ?></th>
    </tr>
    </thead>
    <tbody id="the-list">
    <?php foreach ( $teams AS $team ) : $class = ('alternate' == $class) ? '' : 'alternate'; ?>
    <?php $url = add_query_arg('team_id', $team->id, get_permalink()); ?>
    <tr class="<?php echo $class ?>">
    	<td style="text-align: left;"><a href="<?php echo $url; ?>"><?php echo $team->title ?></a></td>
    	<td style="text-align: center;"><?php echo $team->won_matches ?></td>
    	<td style="text-align: center;"><?php echo $team->draw_matches ?></td>
    	<td style="text-align: center;"><?php echo $team->lost_matches ?></td>
    </tr>
    <?php endforeach; ?>
    </tbody>
    </table>
    
    <?php endif; ?>
    
    <?php endif; ?>
    Plugin Author LaMonte Forthun

    (@lamontef)

    I’m reading your question again, maybe you want the coach and website information, but not the heading? If so, let me know and I’ll repost some code…

    Thread Starter eddyemmer

    (@eddyemmer)

    Hi Lamonte

    I don’t need the heading also the informatie. So your first answer is oke, i’ll try it and let you know.

    Thanks a lot!!!

    Thread Starter eddyemmer

    (@eddyemmer)

    YES!! It works!

    Thanks man!!

    Another question. Is there a widget that show only the teams, like:

    Teams Tournement 2013:
    – Team A
    – Team B
    – Team C
    …etc

    And than you can click on a team and see the information.

    Thanks you!

    Plugin Author LaMonte Forthun

    (@lamontef)

    It depends, if you need a widget because you’re putting it in a sidebar, then two things would have to be done:

    1). A new template made. Do you want logos and Team name or just team name?

    2). The Widget code would have to be updated to allow for the new template. I’m thinking that a better solution might be to allow users to enter a name instead of using a pop-up menu so that new templates could be built as needed, just like if using a short code.

    Now, depending on where you want this list, you could just use a shortcode like before, or you can use some php as outlined in the LeagueManager documentation, it all depends on where you want the list.

    Thread Starter eddyemmer

    (@eddyemmer)

    1). I want only team names.

    2}. I try to put the short code in a Text/HTML widget but that wont work.

    So something with shortcodes is the best for me.

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Delete title Coach and Website’ is closed to new replies.