Jump to content

Tag for nameservers to be used in templates


artaweb

Recommended Posts

3 hours ago, artaweb said:

Is there a cheatsheet for these tags? 

add {debug} to the end of the template code and you'll get a popup window of available variables and arrays for that template - different variables might be used in different tempaltes for the same value, so there's no guarantee that there is a generic variable that can be used on all templates... and don't forget to remove {debug} from the template when you've finished.

Link to comment
Share on other sites

Thanks for that. Its very useful.

I am in this template:

/modules/servers/cpanel/templates/overview.tpl

I want to add server Nameservers and Server  IP address to be displayed in product overview page.

Based on the  debug mode sheet, nameserver tag is $nameserver1$nameserver2 and for server IP: $assignedips

These don't work.

Any idea how  to achieve this?

Link to comment
Share on other sites

16 minutes ago, artaweb said:

Any idea how  to achieve this?

i'm not seeing those variables. 😕

if you're in overview.tpl, I think your friend here will be the $serverdata array..

  • {$serverdata.nameserver1}
  • {$serverdata.nameserver1ip}
  • {$serverdata.nameserver2}
  • {$serverdata.nameserver2ip}

also, if you're going to modify overview.tpl, you might want to consider copying it to your active template folder - otherwise, it would get overwritten during a WHMCS update.

https://docs.whmcs.com/Working_with_Module_Templates

Quote

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 said if you do this, you'd still have to remember to compare the updated overview.tpl manually with your custom version to check for other changes.

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.

×
×
  • 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