Zuse Posted October 26, 2013 Share Posted October 26, 2013 Hello, I am currently working on a template for my WHMCS based on bootstrap for both mobile and desktop. The problem is, ive come to a point where i need to set the label for answered tickets, and tickets uses this form to call for the actual text, ie answered, customer-reply etc. String alone: {$service.statustext} Before edit: <td>{$service.statustext}<td> As you can see, I call for a label-{$service.statustext} i use this because its dynamic, but it seems like it came with some unwanted HTML <td><span class="label label-{$service.statustext}">{$service.statustext}</span></td> but since the {$service.statustext} string, calls for alot more than text alone. I get this, in my html. Not sure how to make the {$service.statustext} display only the actual text ie. Answered, so i can use that to call for a label-{$service.statustext} Thank you all for reading, looking forward to your responses 0 Quote Link to comment Share on other sites More sharing options...
zomex Posted October 28, 2013 Share Posted October 28, 2013 If you just need to support the English language you could use: label-{if $service.statustext eq "Answered"}answered{elseif $service.statustext eq "Awaiting reply"}awaiting{else}{/if} 0 Quote Link to comment Share on other sites More sharing options...
Zuse Posted October 28, 2013 Author Share Posted October 28, 2013 I was looking for a more precise form of fixing this, but while ill wait for that. This will do just fine, ill hope to get it finished soon tho 0 Quote Link to comment Share on other sites More sharing options...
Zuse Posted October 28, 2013 Author Share Posted October 28, 2013 Double post, but whatever. This will not work. As the text color is still changed by the span classes..... 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 28, 2013 Share Posted October 28, 2013 zomex's answer is probably the cleanest way to handle this, but an alternative would be to use replace to remove the unwanted html (if you can isolate it). {service.statustext|replace:"this":"that"} where "this" is what you want to replace, and "that" is what you want to replace it with or "" for blank. you can also use multiple replaces in the same string. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.