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.

how to use the API?

Discussion in 'cPanel Developers' started by daniel-b, Aug 19, 2011.

  1. daniel-b

    daniel-b Member

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

    I've been looking for the parameter / attribute or even variable that let me do this:
    - I want to SHOW a HTML code, but only IF the TITLE of the page (OR ANY OTHER TEXT on the CURRENT PAGE), is SHOWING.

    For example:
    <span>hello</span> will be shown ONLY if the text: "Cron Jobs" (on any language, in that case TCron is the key) is found in the page, for example, so that only the title / text is available on that page...

    How can I do that?, I've trying with several <cpanelif $LANG, but it simply does not work! :( what can I do?

    Thank you.
     
  2. daniel-b

    daniel-b Member

    Joined:
    Jul 28, 2010
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Humm, nobody? I still don't get it :(
     
  3. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    I apologize for the delay, since hostingcon we have been rather busy.

    I am not aware of a way to check a page for a piece of text and use it as a conditional within a plugin. What is the end goal? Are you trying to ensure that a string only appears on cron-related pages?
     
  4. daniel-b

    daniel-b Member

    Joined:
    Jul 28, 2010
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Oh no no, don't worry, I highly appreciate your reply, and I hope you have had a great time! :)

    ---
    Now regarding the concern, what I want to do is a custom header (with several divs, custom styles, etc) for each Feature Page (Change password, MySQL, Cron, etc.. all pages), so I was going to create one page with all the possible headers or custom styles, so each feature page would load only a portion of this code according to its conditional, for example the Cron page will have "this" style (for the title, or any other content), etc, and instead of modifying the Cron page directly, I put its style on an independent file with its own conditional to be loaded once the Cron page is rendered by the cpanel user.

    Mainly because it would be a nightmare modifying every single Theme page for each cPanel feature :S.

    Do you think there is any other way to retrieve the information for a specific single page? at least its ID maybe, or I don't know, a special and unique value for each page...

    I already tried with.. mmm $CPVAR (sorry, I don't remember the exact variable), but as it works with certain and specific text, it will not cover all the languages... and it worked!... but only in English (or the text I used).

    Bye!
     
  5. daniel-b

    daniel-b Member

    Joined:
    Jul 28, 2010
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Owhm :( so it doesn't seem to be possible.
     
Loading...

Share This Page