Sign in to follow this  
Dan

Available balance in postbit

Recommended Posts

Hi,

I was wondering if there is any ability to list the available balance in the user postbit for a points system rather than the total (which includes the amount stored in banks, i think referred to as "worth")

currencyUserBit Template

<a _title="{$currency->_title}" data-ipsTooltip class="ipsSpacer_top ipsSpacer_half ipsBadge ipsBadge_small ipsBadge_{{if $worth < 0}}style5{{else}}style4{{endif}}" href='{url="app=points&module=points&controller=economy&do=statistics&currency={$currency->id}"}'>
  {$currency->display( $worth )} {$currency->pluralized( $worth )}
</a>

 

I want to display the available balance rather than worth, but I dont think the variable ($balance) is available for this particular template? How would I go about changing that?

{$balance->currency()->display( $balance->available )}

 

Edited by Dan

Share this post


Link to post
Share on other sites

@Kevin Carwile when you get a chance could you move this to the support section? I need a little bit of guidance regarding passing variables to templates, so that I can complete my desired result. I haven't had any luck with the IPS4 docs.

Share this post


Link to post
Share on other sites

I ended up finding this valuable resource hidden away on the site: 

 

Final solution for anyone wondering:

<a _title="{$currency->_title}" data-ipsTooltip class="ipsSpacer_top ipsSpacer_half ipsBadge ipsBadge_small ipsBadge_{{if $member->balance(1,0)->available< 0}}style5{{else}}style4{{endif}}" href='{url="app=points&module=points&controller=economy&do=statistics&currency={$currency->id}"}'>
  {$currency->display( $member->balance(1,0)->available )} {$currency->pluralized( $member->balance(1,0)->available )}
</a>

 

  • Like 1

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this