Is sorting possible?
-
Hi, I installed your plugin yesterday and I was wondering if I am able to sort the results by a specific value. Here is the json:
{ "duel_id": 2, "name": "john", "xp": 5214, "level": 8, "xp_percentage": 0.56247, "games": 12, "wins": 6, "champions": [ { "champions_id": 25, "champions_name_key": "hero", "damagedealt": "317", "damagetaken": "458", "matchtime": 612, "games": 98, "wins": 2, "xp": 234, }, ], }
I got the plugin to spit out the values fine, but it is sorting by the champions_id from highest to lowest. I want to be able to sort the champions_id using wins or games or matchtime. How would I go about doing that? This is what my current shortcode looks like:
[jsoncontentimporter url='myapiurlandkey'] {subloop-array:champions:3} <h2 class='widget-title'>{champions.champion_name_key}</h2> <strong>Damage Dealt: </strong>{champions.damagedealt} <strong>Damage Taken: </strong>{champions.damagetaken} <strong>Matchtime: </strong>{champions.matchtime} <strong>Games Played: </strong>{champions.games} <strong>Wins: </strong>{champions.wins} <strong>XP: </strong>{legends.xp} {champions.xp_percentage} <strong>Level: </strong>{champions.level} {/subloop-array:champions} [/jsoncontentimporter]
By the way, is there a way I can convert the matchtime from seconds to hours/minutes?
Any help would be appreciated.Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Is sorting possible?’ is closed to new replies.