Jump to content

side menu link in a panel


Recommended Posts

Hi there, im finding info about how to change the side menu items names, add new links, etc. but im not finding the menu code so i can add it in a panel in the body...i simply wish to add the "Change password" link when you are in a cpanel hosting area in the Product panel. Can someone please provide me this information? Thanx in advance!

Link to comment
Share on other sites

Hi,

 

http://docs.whmcs.com/Working_with_Module_Templates

 

For example, in the case of the provisioning module "cpanel", /modules/servers/cpanel/overview.tpl could be customised by creating the following template file: /templates/yourtemplatename/modules/servers/cpanel/overview.tpl

that's the template you're going to want to edit to do this - i'd recommend copying the above template to your custom template as described in the docs... otherwise any changes you make today might get overwritten by a future WHMCS update.

 

                <p>
                   <a href="http://{$domain}" class="btn btn-default btn-sm" target="_blank">{$LANG.visitwebsite}</a>
                   {if $domainId}
                       <a href="clientarea.php?action=domaindetails&id={$domainId}" class="btn btn-success btn-sm" target="_blank">{$LANG.managedomain}</a>
                   {/if}
                   <input type="button" onclick="popupWindow('whois.php?domain={$domain}','whois',650,420);return false;" value="{$LANG.whoisinfo}" class="btn btn-info btn-sm" />
                   {if $module eq "cpanel"}
                   <a href="#tabChangepw" class="btn btn-danger btn-sm" data-toggle="tab">{$LANG.serverchangepassword}</a>
                   {/if}
               </p>

most of that block of code is already there in the template, what i've added is that final <a href> line to add a button to change the password...

 

CiGl26n.png

you might need to tweak the layout slightly as you would run into an issue if you could manage the domain and thus have four buttons...

 

                <p>
                   <a href="http://{$domain}" class="btn btn-default btn-sm" target="_blank">{$LANG.visitwebsite}</a>
                   {if $domainId}
                       <a href="clientarea.php?action=domaindetails&id={$domainId}" class="btn btn-success btn-sm" target="_blank">{$LANG.managedomain}</a>
                   {/if}
               </p>
               <p>
                   <input type="button" onclick="popupWindow('whois.php?domain={$domain}','whois',650,420);return false;" value="{$LANG.whoisinfo}" class="btn btn-info btn-sm" />
                   {if $module eq "cpanel"}
                   <a href="#tabChangepw" class="btn btn-danger btn-sm" data-toggle="tab">{$LANG.serverchangepassword}</a>
                   {/if}
               </p>

 

OSvYaSd.png

Link to comment
Share on other sites

Thanx very much! Just a last question, is there any way to pass a variable so when you click in the Change password button the side menu highlight the Change password field? As is when you click in the change password button (in the code above) keep highlighting the Information link/row in the side menu.

 

Thanx again!

Link to comment
Share on other sites

Thanx very much! Just a last question, is there any way to pass a variable so when you click in the Change password button the side menu highlight the Change password field? As is when you click in the change password button (in the code above) keep highlighting the Information link/row in the side menu.

interesting question - i'm tempted to think not because the whole page isn't refreshing, it's merely referencing a tab change.

 

it would work (re active sidebar link) if you linked the button to open in a new tab/window...

 

<a href="#tabChangepw" class="btn btn-danger btn-sm" target="_blank">{$LANG.serverchangepassword}</a>

so it might be a case of deciding which you prefer - highlighting the sidebar or opening the change password link in the existing tab. :?:

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