Jump to content

Custom home page panels


ffeingol

Recommended Posts

From what I've been able to figure out so far (reading the forum and digging into template code etc.) I take it that there is no way to customize the home page panels. I'd like (for example) to show recent support tickets differently. I assume I'd have to use a hook to remove the panel and the code a hook to recreate it.

 

I know how to remove the panel (as I've removed several already that we don't use). I'm also pretty sure I can write the HTML to grab what I want. My issues that that I'd like to show a small table (ticket number, ticket subject, status, last activity date). I'm not really sure how template that, since the panels all seem to be in a generic formatting loop in the template.

 

Thanks in advance for any advice.

Link to comment
Share on other sites

From what I've been able to figure out so far (reading the forum and digging into template code etc.) I take it that there is no way to customize the home page panels. I'd like (for example) to show recent support tickets differently. I assume I'd have to use a hook to remove the panel and the code a hook to recreate it.

you could take it's existing content, modify it and then send it's output back to the panel (i've posted hook code in the thread below that does that previously) - but for all but the most simple panels, it would be easier as you say to delete the existing panel and recreate it... also, if you modify an existing panel, you're not necessarily fully in control of when it's displayed... if you create it, you are. :idea:

 

http://forum.whmcs.com/showthread.php?111614-how-can-i-hide-some-fields&p=457799#post457799

 

the above code doesn't delete and recreate the sidebar, it takes an existing sidebar and modifies its content - in terms of using hooks, the process is very similar whether you're working with a navbar, sidebar or panel.

 

I know how to remove the panel (as I've removed several already that we don't use). I'm also pretty sure I can write the HTML to grab what I want. My issues that that I'd like to show a small table (ticket number, ticket subject, status, last activity date). I'm not really sure how template that, since the panels all seem to be in a generic formatting loop in the template.

well, you'll still be looping... but just inside a table ! :)

 

if you're looking to use a homepagepanel hook, then you'll generally need to do three things...

 

1. query the database and/or class to get the variables you need.

2. modify the results to your own specific needs.

3. output results to the panel.

 

for example, with regards to the existing support tickets panel, the array (when it exists) is also available in Smarty... so you have the option of adding a panel (or doing something outside of a panel), purely in Smarty/HTML in the clientareahome.tpl template instead of using an action hook - which method to use is down to your experience and knowledge - and also what you want to do with its output and if that's easier to do via PHP or Smarty.

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