Jump to content

Hooks & Sidebar Customisation


harry1

Recommended Posts

Hi guys,

Two question's here. I'm trying to display Client Credit on the Client Area Homepage:

 

    if (!is_null($primarySidebar->getChild('Client Details'))) {
        $primarySidebar->getChild('Client Details')
            ->addChild('Current Credit')
                ->setLabel('Credit: $' .$currentCredit)
                ->setOrder(100);
    }

 

This works fine, however. I'd ideally like to do this:

->setLabel('<font color="green">Credit: $' .$currentCredit)

And also style the $currentCredit variable. Any suggestions as to how to do this?

Also, I'm trying to use ->setIcon('') however the icon is being displayed at the end of the text (on the right) instead of at the start (on the left).

Any suggestions are greatly appreciated!

 

Cheers

Harry

Link to comment
Share on other sites

Hi Harry,

7 hours ago, harry1 said:

Two question's here. I'm trying to display Client Credit on the Client Area Homepage:

there's no point in reinventing the wheel, there's already a sidebar hook that does that...

numerous variations and additions to that in the thread...

7 hours ago, harry1 said:

This works fine, however. I'd ideally like to do this:

->setLabel('<font color="green">Credit: $' .$currentCredit) 

And also style the $currentCredit variable. Any suggestions as to how to do this? 

i'd suggest using sentq's hook for this as it could be modified for your styling needs...

Un23ZSh.png

8 hours ago, harry1 said:

Also, I'm trying to use ->setIcon('') however the icon is being displayed at the end of the text (on the right) instead of at the start (on the left).

that's expected behaviour - in v7, icons would be on the right; in v6, they used to be on the left... those positions are defined in the template...

the usual way to get around it would be to use bodyhtml rather than a label... if you do that, you can put the FA code before the output...

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