Compact Display?
-
I absolutely love this plugin!! Is there any way of compacting the badges, like they are done here?
That feature alone would be incredible!! Thanks guys for making such a great plugin!
Mark
-
So you’re wanting just a basic listing of earned badges?
Yessir!
Right now, the standard display really only allows 3-4 achievements to be displayed without scrolling. If badges can be displayed side by side (both horizontally and vertically) then a site could display 20-30 badges in the same screen length. I see tremendous value in a feature like that.
If you know how to use the wp_query class at all, you could roll your own solution with this. The badges are simply custom post types. This way you could query for however many you wanted at a time and display them however you wanted. Hope that helps put you on your way, but if you’re completely lost, let me know and I can try to help some more.
I feel bad to say I am not good at coding. In your estimation, how difficult would this be to implement? Like say if it took a half hour to code, I’d be willing to donate 20 bucks to you, and then everyone can benefit from the compact display! If it’s a more daunting task than a half hour then perhaps I’ll tackle this myself once I’ve learned more about how WordPress coding works.
Thanks for the timely responses! I really enjoy this plugin.
Mark
So that I know what I’m helping with, is this a list of badges available? or a list that a certain user has earned? or perhaps ones they have given to others?
It would be for both the list of badges available and also the profile display for the ones each user has earned. Basically, my badges are quite self-explanatory, as you can see here:
https://allmyleagues.com/home/aml-achievements-update/
If the banners could be displayed in a compact manner like that (but dynamically, of course), it would look quite sharp on my site!
If I had to pick one, I would request that the display of all badges available was compacted first, and the personal badges was compacted if you had the time.
How much of those badges are hardcoded into the badge image? What parts are something like post content/title/etc ? I assume at least the center part + the year spans aren’t going to be part of the badge image.
It’s all hardcoded. I have automated processes set up on my computer that spit out the awards.
Not in terms of awarding, in terms of the actual display of the badge. Trying to separate out the content.
For example. the image part would be the Green shield and “Football Standard Dynasty” at the top, and the rest of the text wouldn’t be there. The name of the badge, that shows up in the title field, isn’t in the image, and would need to be overlayed, as well as the years that are associated with the badge somehow. Post meta for example.
To query for the badges with that setup, I’d need to grab the badge image, located in WP’s featured image spot, the badge title, and the badge meta.
Chances are in this case, i’d use the badge image as an inline css style for a background image, then echo the title/meta inside the div that the image is a background for.
Hm ok, I think I understand you now. Let’s see if I do ??
The post titles for all the banners would be Year,Sport,League,Placement.
Examples of post titles:
2012-2013 Football Standard Dynasty – 1st Place
2012 Baseball Standard Dynasty – 3rd Place
2011-2012 Hockey Invitational League – 2nd PlaceDoes that help, or am I still not understanding?
Sorry for the delay in replying. The layout I assume you want on the badge would be possible easy enough if you separated the year, sport, league and placement by commas in the title field.
2012-2013, Football, Standard Dynasty, 1st Place
Then we could use the php explode function to get each comma-separated area into individual pieces. If you can stay consistent in the order that they’re listed, then we can also make the badges really easy to do too.
Ok, here’s what I have, at least for a first round before any noticed refinement is needed. I provided comments in places I think would need them, but ask questions as you get them. This one is going to query for all available badges and loop them with display.
<?php $args = array( 'post_type' => 'badges', 'posts_per_page' => -1 ); $badges = new WP_Query( $args ); if( $badges->have_posts() ) : while( $badges->have_posts() ) : $badges->the_post(); //set up our variables. $parts = explode(',', get_the_title() ); //assign each part to an individual variable for easier reference $year = $parts[0]; $sport = $parts[1]; $league = $parts[2]; $placement = $parts[3]; //grab just the URL for the featured image, assign to an individual variable. $imgsrc = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID ), "Full"); $badgeimg = $imgsrc[0]; ?> <?php //Start our output of the badge, assigning the badge image to a css background, inline. ?> <div class="amlbadge" style="background: url('<?php echo $badgeimg; ?>') no-repeat;"> <p><?php echo $sport; ?> <?php echo $league; ?></p> <p><?php echo $placement; ?></p> <p><?php echo $year; ?></p> </div> <?php endwhile; wp_reset_postdata(); endif; ?>
Hey allmyleagues, any luck with this, if you had the chance to give it a go?
Michael, I am also looking for a solution to display a list of individual user badges within their buddpress and standard profile. I am one of the site admins at https://SportsUnbiased.com and we could really use some help.
TheBigAdmin1, it sounds like your request is more for individual user earned badges while this thread is more listing all available ones in a “compact” way. If you could start your own thread, I’d gladly help there. Please include all details you can for what you’re looking for with it.
- The topic ‘Compact Display?’ is closed to new replies.