Jump to content

customize inline css in clientarea.php six template (specifically, change colors)


wulfric

Recommended Posts

I wish to customize label colors for clientarea.php - take this green for example, I want to make it #321XYZ instead.

 

IQuBLo4.png

 


  • WHMCS 7
  • template = six
  • clientareahome.tpl > ctrl + f "label" > around line 90

 

When visitor logs into clientarea.php they are presented with the Service, Domains, Tickets and Invoice tiles. Beneath the tile section, there is a "Recent Support Tickets" area with code that I wish to cleanup.

 

<label class="label" style="background-color: #779500">Open</label>

 

- - - Updated - - -

 

I've also noticed this color, the labels inline style, is also found on the sidebar for tickets too.

 

Client Area > Support Tickets > View Ticket

 

MJxOFP5.png

 

<span class="label" style="background-color:#779500;">Open</span>

Link to comment
Share on other sites

When visitor logs into clientarea.php they are presented with the Service, Domains, Tickets and Invoice tiles. Beneath the tile section, there is a "Recent Support Tickets" area with code that I wish to cleanup.

for some reason, WHMCS look to have hard-coded the bg colors into the homepage panels... they're not using the css classes... :roll:

 

that makes changing them awkward... I think you're left with two effective methods - the "proper" way and the "quick" way... neither are great.

 

the proper way would be to write an action hook to either recreate the content of the panel (add add your color changes) or take the existing panel content, do a string replace on the color element and output the panel... a lot of hassle.

the quick way would be to edit clientareahome.tpl and change...

 

{$childItem->getLabel()}

to...

 

{$childItem->getLabel()|replace:'#000000':'#FF0080'|replace:'#888888':'#00FF00'}

as an example, this changes the colors for 'Answered' and 'Closed' to some bright alternatives! :)

 

QsubddS.png

 

you might want to do some thorough testing to ensure it's not changing any other occurrences of that color - though you could easily wrap the statement in an IF statement so that it would only change this one panel, but that may or may not be necessary.

 

                                            {if $item->getName() eq 'Recent Support Tickets'}                                        
                                               {$childItem->getLabel()|replace:'#000000':'#FF0080'|replace:'#888888':'#00FF00'}
                                           {else}
                                               {$childItem->getLabel()}
                                           {/if}

 

I've also noticed this color, the labels inline style, is also found on the sidebar for tickets too.

same problem as above - similar solution... except this time it's in includes/sidebar.tpl and change...

 

                        <div menuItemName="{$childItem->getName()}" class="list-group-item{if $childItem->getClass()} {$childItem->getClass()}{/if}" id="{$childItem->getId()}">
                           {if $childItem->hasBadge()}<span class="badge">{$childItem->getBadge()}</span>{/if}
                           {if $childItem->hasIcon()}<i class="{$childItem->getIcon()}"></i> {/if}
                           {$childItem->getLabel()}
                       </div>

to...

 

                        <div menuItemName="{$childItem->getName()}" class="list-group-item{if $childItem->getClass()} {$childItem->getClass()}{/if}" id="{$childItem->getId()}">
                           {if $childItem->hasBadge()}<span class="badge">{$childItem->getBadge()}</span>{/if}
                           {if $childItem->hasIcon()}<i class="{$childItem->getIcon()}"></i> {/if}
                           {$childItem->getLabel()|replace:'#779500':'#336699'}
                       </div>

it's only that next to last line that's changed, but i've added the rest of the block to help you identify what to edit.

 

BRBEIqK.png

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