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.

Syntax question for the skin wizards

Discussion in 'User Experience' started by ecoutez, Aug 8, 2002.

  1. ecoutez

    ecoutez Well-Known Member

    Joined:
    May 23, 2002
    Messages:
    152
    Likes Received:
    0
    Trophy Points:
    0
    Hey folks,

    I'm trying to use an include which will bring up a file which has the account owner as part of the file name. ie - if the account is owned by root, then it would bring up /tables/root-support.html If it were owned by joe, then it would grab /tables/joe-support.html

    I did something similar to give resellers their own logo based on the owner variable, and that has worked fine. Now I want to add a custom table for support links... online payments, support center, account upgrades, etc -- all things which the reseller would generally have on his own website, but which would ideally be linked from in CPanel as well.

    So I tried this... (replace hard brackets [ and ] with appropriate & and & of course)

    [cpanel include=&tables/[cpanel print=&$CPDATA{'OWNER'}&]-support.html&]

    It fails because it sees the second set of quotes and closes the include, and then displays something like &root-support.html& as text on the screen. I assume it wasn't happy with a cpanel link being embedded in another one. So I also tried several variations of this...
    [cpanel include=&tables/$CPDATA{'OWNER'}-support.html&]

    Also no luck.

    FWIW, if anyone is curious about my syntax for the logo display, the above should be a good hint... but here's what I used:
    [img src=&[cpanel printvar=&dprefix&][cpanel print=&$CPDATA{'OWNER'}&]-cp.gif&]

    Any help would be appreciated!

    Thanks,
    Jason
     
  2. parag

    parag Well-Known Member

    Joined:
    Aug 16, 2001
    Messages:
    115
    Likes Received:
    0
    Trophy Points:
    16
    [quote:3885f56dca][i:3885f56dca]Originally posted by ecoutez[/i:3885f56dca]

    Hey folks,

    I'm trying to use an include which will bring up a file which has the account owner as part of the file name. ie - if the account is owned by root, then it would bring up /tables/root-support.html If it were owned by joe, then it would grab /tables/joe-support.html

    I did something similar to give resellers their own logo based on the owner variable, and that has worked fine. Now I want to add a custom table for support links... online payments, support center, account upgrades, etc -- all things which the reseller would generally have on his own website, but which would ideally be linked from in CPanel as well.

    So I tried this... (replace hard brackets [ and ] with appropriate & and & of course)

    [cpanel include=&tables/[cpanel print=&$CPDATA{'OWNER'}&]-support.html&]

    It fails because it sees the second set of quotes and closes the include, and then displays something like &root-support.html& as text on the screen. I assume it wasn't happy with a cpanel link being embedded in another one. So I also tried several variations of this...
    [cpanel include=&tables/$CPDATA{'OWNER'}-support.html&]

    Also no luck.

    FWIW, if anyone is curious about my syntax for the logo display, the above should be a good hint... but here's what I used:
    [img src=&[cpanel printvar=&dprefix&][cpanel print=&$CPDATA{'OWNER'}&]-cp.gif&]

    Any help would be appreciated!

    Thanks,
    Jason
    [/quote:3885f56dca]


    Hi Jason

    You did the correct thing but you forgot to have the hyperlink tag

    [a href=&tables/[cpanel print=&$CPDATA{'OWNER'}&]-support.html&] [cpanel include=&tables/$CPDATA{'OWNER'}-support.html&] [/a]

    this will work

    this will print the & tables/root-support.html & and also have a link to it. There is a better way to do it - so that it will print &Support Text& and have a link to root-support.html -

    =======================================
    This is the better way
    =======================================
    [a href=&/tables/[cpanel print=&$CPDATA{'OWNER'}&]-support.html&] Support Link [/a]

    =======================================

    enjoy... mail me if you need any other help ;)

    best regards,
    Parag
     
  3. kosmo

    kosmo Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    403
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    All over Europe
    [cpanel include=&tables/$CPDATA{'OWNER'}-support.html&]

    This will not work. A CPanel command can not contain another CPanel command. I had this problem myself and didn't find a solution.

    kosmo
     
  4. ecoutez

    ecoutez Well-Known Member

    Joined:
    May 23, 2002
    Messages:
    152
    Likes Received:
    0
    Trophy Points:
    0
    Thanks Parag and Kosmo

    I didn't forget the [a href] part - I was trying to include a html file. Take a look at the include statements in the bluelagoon index.html file. All those tables are included from seperate files. I wanted to add another table with a handfull of hardcoded links, and have the index.html file pull up the approriate table based on the owner/reseller of the account. That would give me the ability to give the reseller his own area for a few links based on his particular need - be it billing links, contact information, use policies, support forum, etc.

    I suspect I could do something like, [a href=&[cpanel print=&$CPDATA{'OWNER'}&]-support-redirect.html&]Hosting Support[/a]

    The only downside with this is that I would have to decide on the links for everyone. I'll have to take a look at how that CPanel &If& stuff works - maybe that can be helpful. That or find a way to dump the owner information to another variable that I could pull up without having to embed another [cpanel] command.

    Thanks again,
    Jason
     
Loading...

Share This Page