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.

edit cPanel Page Title or Text variable

Discussion in 'User Experience' started by daniel-b, Sep 1, 2011.

  1. daniel-b

    daniel-b Member

    Joined:
    Jul 28, 2010
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Hello there,

    I'm looking for a variable that works as indicator for a text displayed in the cPanel screen, for example:
    if $word = Cron Jobs, then render this html content...

    However I've been trying to find such ability but it simply does not exist!... and I'm unable to create custom headers for cpanel pages because of this.. I've found $CPVAR but it doesn't work with all languages, as it only works with specific text you put as value... and $LANG does not work for all locale language keys.

    Its really frustrating! and my other thread was simply removed I don't know why!...
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    $LANG is deprecated and will not work with newer phrases that utilize the new locale system.

    If you're looking to customize text in the cPanel interface, the easiest way to do this would be to create your own language file and use the live editor for locales to customize the text as you see fit. Just be sure to assign this new custom locale to your customers.
     
  3. daniel-b

    daniel-b Member

    Joined:
    Jul 28, 2010
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Hello David,

    I appreciate your response, however I do NOT want to create a new locale, I want to invoke a language key from a Locale to render it on X page...

    For example locale KEY for phrase "Cron Job" is "$cron-job-title" so I go to my CUSTOM cPanel page and add: "$cron-job-title" with a conditional, for example IF $cron-job-title = etcetcetc then render this html output.

    However I can't locate any way to invoke a language key, that seems to be just impossible!, and that would make my designer work just much more difficult :( what to do?

    Regards.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,448
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Sounds to me like you're wanting to create a page outside cPanel using cPanel's locale system? Not sure I understand what it is you're wanting to do exactly.
     
  5. daniel-b

    daniel-b Member

    Joined:
    Jul 28, 2010
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    I think that's exactly what I need, but let me clarify:

    I want to make a custom cPanel theme. By default each cpanel page has a title, for example Cron Jobs. I will make a custom header for each title, so instead of editing the hundred of files and their Titles, I want to make a single html page, that contains the custom header for every single title, do you understand what I mean?

    For example.

    Cron Jobs will be RED. But MySQL page and Change Password page will have RED color too (the title).
    So instead of going to the Cron Jobs, MySQL and Change Password html files, I'd like to create a single custom file, named "header.html" (for example), that includes the custom styles for each title, all that in one file and pure cpanel code :P

    In order to do so (and so many further changes) I need to include the language keys, and use them in conditionals so any language will render the same styles...

    I hope you understand what I need now.

    Regards.
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,448
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I think I have an idea of what you want to do, but I'm unclear on how you're going about it.

    When you speak of the "hundreds of files" it sounds like you're looking to edit the theme files, instead of editing thru the Branding editor. Is that right?


    From an earlier post:
    Have you seen this page:
    Available cPanel Plugin Variables

    Not sure how helpful that is.
     
  7. daniel-b

    daniel-b Member

    Joined:
    Jul 28, 2010
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Hi sir!,

    Indeed I want to create a NEW theme, not simply editing a x3's style... which is not what I want...

    Thanks for the link, indeed it is very helpful, however I already knew that page, and unfortunately the $LANG{'KEY'} variable is deprecated, and the variable $CPVAR{‘KEY’} works perfect, but only with absolute values, such as "bob" or "cron jobs" in this case, but in Spanish would not work as "cron jobs" could have another definition, so I need relative values, so any language would work similarly for the same conditional.

    Here is an example, I guess you all know smarty, right?

    Now, let me show you the perfect example for what I want to do, BUT using cPanel.
    (sorry, is not the best code I could do, long time ago I don't use it and I simply want to show you the logic of this..)
     
  8. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Given that piece of logic of what you're trying to do, have you considered going by URL instead? URLs are consistent across locales, you'll just need to compensate for the session identifier part of the URL (/cpsess12345.../).
     
  9. daniel-b

    daniel-b Member

    Joined:
    Jul 28, 2010
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    do you know of any native variable that helps me to identify the URL of the page? I never thought of that solution, very smart and handy, thank you very much David.
     
  10. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Most programming languages will supply that to you through their own variables (PHP, JavaScript etc.)
     
  11. daniel-b

    daniel-b Member

    Joined:
    Jul 28, 2010
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Well, yes, in this case I will be using javascript (I was wondering if there was a native way to achieve it with cpanel)... you guys should develop more specialized tools for theme modifications :( even being a simple system, it requires a lot of testing (that takes a lot of time) and can be very frustrating :P
     
Loading...

Share This Page