The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

using standard header templates in my WHM app

Discussion in 'cPanel Developers' started by rustyhex, Jul 24, 2013.

  1. rustyhex

    rustyhex Member

    Joined:
    Jul 18, 2013
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    When i use
    [% INCLUDE "_defheader.tmpl" %], i get the following error:

    Template rendering failed: plugin error - Whostmgr: plugin not found
     
  2. cPAndrewHodge

    cPAndrewHodge cPanel UI Developer
    Staff Member

    Joined:
    Dec 10, 2012
    Messages:
    52
    Likes Received:
    3
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Try this:

    [% PROCESS '_defheader.tmpl' -%]
     
  3. rustyhex

    rustyhex Member

    Joined:
    Jul 18, 2013
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Still does not work. I put my templates to:
    Then i use TemplateToolkit's process with
    in my addon_*.cgi.
    I've tried to put my templates to /usr/local/cpanel/whostmgr/docroot/templates, but nothing happened.
     
  4. cPAndrewHodge

    cPAndrewHodge cPanel UI Developer
    Staff Member

    Joined:
    Dec 10, 2012
    Messages:
    52
    Likes Received:
    3
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Here's a breakdown since I recently went through the process of dropping something into WHM.

    Template file goes into: /usr/local/cpanel/whostmgr/docroot/templates

    Wrap it with this(you can remove scripts / stylesheets if you aren't using any external ones):

    This uses the latest WHM Master template, the _defheader is something we're moving away from. Now when we call Templates we have to use Cpanel::Template and it usually looks like this...
    The breadcrumbs / heading is based on the /usr/local/cpanel/whostmgr/docroot/themes/x/command2 file which I believe is modified when you register the plugin and appropriate files are regenerated. My knowledge of WHM plugin development is a little fuzzy so I'll try and investigate for you.

    edit: Here's a pastebin link since the formatting gets destroyed in this: http://pastebin.com/Fqq3MUvp
     
    #4 cPAndrewHodge, Jul 29, 2013
    Last edited: Jul 29, 2013
  5. rustyhex

    rustyhex Member

    Joined:
    Jul 18, 2013
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    It helped, thanks. Works from my CGI's, but it does not work from addon_myWHMaddon.cgi. There's no errors in cpanel error log, but process_template displays a blank page.
     
  6. cPAndrewHodge

    cPAndrewHodge cPanel UI Developer
    Staff Member

    Joined:
    Dec 10, 2012
    Messages:
    52
    Likes Received:
    3
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    What does your code look like at this point? A blank page usually indicates a wrong directory path.
     
Loading...

Share This Page