Jump to content

Badge Icons not displaying on posts


Go to solution Solved by Nathan Explosion,

Recommended Posts

I'm hoping to assign badges to specific posts. I've set up a few with custom icons. These two badges are to be manually assigned to posts by admin only and will indicate if we endorse the post.  For example: "Supported by research" or "Endorsed by LTA".

Assigning badges works well, but for some reason the icons related to the badges don't display with the post.  Here's an example of what is displayed.

image.thumb.png.0206920a99db4d132783dae402b1ee96.png

 

The icon assigned to the 'Endorsed by LTA' badge looks like this, but is nowhere to be seen on the post.

  image.png.c3482fedd638d5dabc55ae259c96dbeb.png

Anyone know if there's a way to ensure this icon is displayed with the post the badge is awarded to?

Link to comment
Share on other sites

  • Solution
Marc Stridgen
This post was recognized by Marc Stridgen!

Nathan Explosion was awarded the badge 'Helpful' and 5 points.

Here's your starter...

Edit the following template in your theme:

core -> front -> global ->commentRecognized

Add the following at the start of the template:

{{if($comment->recognized->badge)}}
	{{$badge = \IPS\core\Achievements\Badge::load($comment->recognized->badge );}}
{{endif}}

Then add this where you want the badge displayed:

{{if ISSET($badge)}}
	{$badge->html()|raw}
{{endif}}

That will give you a full size badge - experiment with the following to change the size....range is 1 (small) to 8 (large)

{{if ISSET($badge)}}
	{$badge->html('ipsFlex-flex:00 ipsDimension:4', FALSE, TRUE)|raw}
{{endif}}

 

Could contain: Text

Edited by Nathan Explosion
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...