Jordan Posted September 15, 2007 Share Posted September 15, 2007 I've been working on doing heavy modifications to the template system, and there's a view things that seem to have been hard-coded in, that I was wondering if it would be possible to sort of stylize with css. I'm basically referring to things like: {$ticket.urgency} {$LANG.invoicesstatus} {$ticket.status} I have a few ideas where I want to have classes applied to them. With {$ticket.urgency}, I want to be able to have elseif statements applied, so if the ticket is high, the background will be red, if it's low, the background would be green. Same thing with the rest of the other "status" functions. Would this be possible? I really don't like having to rely on the old html being used (<font color="hex"></font>). :\ 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted September 15, 2007 WHMCS CEO Share Posted September 15, 2007 The font colors are hard-coded so unfortunately no way to modify. Matt 0 Quote Link to comment Share on other sites More sharing options...
Jordan Posted September 15, 2007 Author Share Posted September 15, 2007 Yeah, I figured as much. I was just hoping to have more control over it, much like with {$account.class}, when viewing the hosting accounts/services, to show if it's active, pending, suspended, or terminated. *sniffles* 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted September 15, 2007 Share Posted September 15, 2007 its dirty, but you can just create a smarty modifier plugin that strips any html from a smarty variable, then just add your own css. Something like: <span class="blah">{$var|removehtml}</span> Its not a perfect solution, but its better than living with incorrect code on your site. If you need help writing the plugin, just ask and i can throw that together for you in 2 mins. 0 Quote Link to comment Share on other sites More sharing options...
Jordan Posted September 16, 2007 Author Share Posted September 16, 2007 Well, it's not so much about incorrect code (although I would prefer to use that to get rid of it!) but what I really want to be able to do, is actually apply a class so that it reflects the account's status. Much similar to how Matt has <td id="{$account.class}"> I pretty much want that capability with {$ticket.urgency}, {$LANG.invoicesstatus}, {$ticket.status} so that I can make it purdy with CSS and whatnot. I'm sure if I really look through all the code, I can find something a little more specific (assuming it exists) to use it. Worst case scenario is that I don't get to do anything to it and it stays as is :\ 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted September 16, 2007 Share Posted September 16, 2007 you could do that as well, but whats wrong with my advice? It will help you accomplish your need without having to rely on matt to make the change. I would also consider it incorrect code as <font> is not really used these days as <span> would be the correct way to do it. Heck, DocTypes arent even used in the tempates. Anyway, we all know that hard coding markup into encrypted files is a no no. Especially with a 100% templated client area. Like i said Jordan, just ask and i will create the smarty plugin for you. 0 Quote Link to comment Share on other sites More sharing options...
Jordan Posted September 16, 2007 Author Share Posted September 16, 2007 Well, if this is something that you wouldn't mind doing, I would love you forevvver and ever if you wanted to create something that would allow me to be able to customize {$ticket.urgency}, {$LANG.invoicesstatus}, {$ticket.status} using an id/class so that it can reflect whatever style I apply to it to match it's status =) 0 Quote Link to comment Share on other sites More sharing options...
Jordan Posted September 17, 2007 Author Share Posted September 17, 2007 Well, so far I was able to get part of the effect I wanted by just using: <td class="{$ticket.urgency}"><span class="{$ticket.urgency}">{$ticket.urgency}</span></td> 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted September 17, 2007 Share Posted September 17, 2007 lol, i was just about to make the plugin when i realized smarty already has it. Just do: {$ticket.urgency|strip_tags} This will remove any html markup in that variable so your free to style it the way you please. 0 Quote Link to comment Share on other sites More sharing options...
Jordan Posted September 17, 2007 Author Share Posted September 17, 2007 Thank you MAC =) 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.