Jump to content

Changing class of a div


cuddylier

Recommended Posts

Hi

 

I'm currently trying to edit the class names of some divs on the 'clientarea.php?action=invoices' page as seen below:

 

 

<div class="panel-footer clearfix">

<div class='col-xs-6 col-button-left'>

<a href="clientarea.php?action=masspay&all=true" class="btn btn-success btn-sm btn-block"{$massPayDisabled}>

<i class="fa fa-check-circle"></i>

Pay All

</a></div><div class='col-xs-6 col-button-right'>

<a href="clientarea.php?action=addfunds" class="btn btn-default btn-sm btn-block">

<i class="fa fa-money"></i>

Add Funds

</a></div>

</div>

</div>

 

I need to change xs-6 to xs-5 on the button-left and xs-6 to xs-7 on button-right.

 

Where do I find the code in the template files to do this?

 

Thanks

Link to comment
Share on other sites

Where do I find the code in the template files to do this?

you don't - that's the "My Invoices Summary" sidebar isn't it ?

 

5vPygpf.png

 

if so, then I think you have three options...

 

1. edit that sidebar via an action hook - specifically the footer.

2. remove that existing sidebar and create a new sidebar styled however you want it.

3. possibly by editing templates/*your template*/includes/sidebar.tpl

 

I suspect of the three, the first would be the best solution; the second would be long-winded... and the third might be tricky and would have to be re-added if/when a WHMCS update changed the file anyway.

Link to comment
Share on other sites

just for completion, I quickly wrote the hook for this... create a new .php file in /includes/hooks and paste the code below into it...

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{

   $newfooter = '<div class="col-xs-5 col-button-left">
                   <a href="clientarea.php?action=masspay&all=true" class="btn btn-success btn-sm btn-block"{$massPayDisabled}>
                   <i class="fa fa-check-circle"></i> '.Lang::trans('masspayall').'</a>
               </div>
               <div class="col-xs-7 col-button-right">
                   <a href="clientarea.php?action=addfunds" class="btn btn-default btn-sm btn-block">
                   <i class="fa fa-money"></i>  '.Lang::trans('addfunds').'</a>
               </div>';

   if (!is_null($primarySidebar->getChild('My Invoices Summary'))) {
           $primarySidebar->getChild('My Invoices Summary')
                           ->setFooterHtml($newfooter);
   }
});

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