Customize index.tt
Hello,
I have added below code in the index.tt file
[% IF quota_info.inodes_used < 600000 %]
[% ELSE %]
Here I want to add the conditoin.
If the package is ABC, the I want to show inode count 250000
What change I need need to make here?
Thanks
-
Without knowing more about specifically what index.tt file you are referring to (maybe a full path?), I'll probably not be able to give a good answer to this. I can't really know what variable the package name is going to be stored in if I can't figure out the context here. Can you also reply with what version of cPanel you are working with and what theme (paper_lantern or jupiter) is in use? Knowing these things will help me narrow down the correct answer. 0 -
Oh I am sorry. cpanel version is 110.0.2 and I am using Jupiter theme. The path of index file is : /usr/local/cpanel/base/frontend/jupiter/tools/index.tt The package name is Startup. 0 -
So, the variable you will want to reference in this file would be `CPANEL.CPDATA.PLAN`, as that would correspond to the logged in user's package name. For reference, the CPANEL.CPDATA variable is just a hash table of the contents of `/var/cpanel/users/$user` where `$user` would be whoever happens to be logged in. With that you'd probably want an if block like [% IF CPANEL.CPDATA.PLAN == 'Startup' %] [% quota_info.inodes_used = 250000 %] [% END %] And that ought to set the inodes_used parameter in the way you specified earlier (presuming I understood you correctly). Hope this helps! 0 -
Thank you so much. But how can I keep 600000 limit for other packages as it is? 0 -
So long as the IF block for manipulating the value in quota_info.inodes_used from my previous post is keying on CPANEL.CPDATA.PLAN being equal to 'Startup', I don't see how that would be a problem. Other packages should retain the original value based on the logic there. 0 -
I managed by using below code [% IF CPANEL.CPDATA.PLAN == 'ABC' %] [% quota_info.inodes_limit = 250000 %] [% ELSE %] [% quota_info.inodes_limit = 600000 %] [% END %] Once again thank you for your help Thomas! 0
Please sign in to leave a comment.
Comments
6 comments