Jump to content

Styling functions


Jordan

Recommended Posts

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>). :\

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :\

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 =)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
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.

  • Recently Browsing   0 members

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

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated