selym Posted August 14, 2008 Share Posted August 14, 2008 Hello, I would like to create two new pages with WHMCS since my site copy/content will fit on two pages, it makes more sense to build my site around WHMCS and keep everything looking similar. I found this page (http://wiki.whmcs.com/Creating_Pages) but I'm not exactly sure what to do with the code. I created a new file and pasted that code into it, but that didn't work. Can anyone explain exactly how to create a new page, or perhaps point me in the right direction please? Thank you very much. Selym 0 Quote Link to comment Share on other sites More sharing options...
chickendippers Posted August 14, 2008 Share Posted August 14, 2008 The wiki page was lacking in detail; I've elaborated for you. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted August 15, 2008 Share Posted August 15, 2008 OK here goes 1. First create a new file using your favourite text editor and copy and paste the following code into it as it says in the wiki: <?php define("CLIENTAREA",true); require("dbconnect.php"); require("includes/functions.php"); $pagetitle = $_LANG['clientareatitle']; $pageicon = "images/support/clientarea.gif"; $breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a> > <a href="mypage.php">My Page</a>'; require("init.php"); if ($_SESSION['uid']) { # User is Logged In - put any code you like here } # Define the template filename to be used without the .tpl extension $templatefile = "homepage"; # To assign variables in Smarty use the following syntax. This can then be used as {$variablename} in the template $smartyvalues["variablename"] = $value; require("display.php"); ?> Now edit the variables on that page $pageicon - To change the icon image on the right side top of the content area $breadcrumbnav - Change the link at the end of the line to suit your new page. $templatefile - Change the name in between the quotes to the name of your template file. (without the .tpl extension) $smartyvalues - As the description above it says Save the file to what your new page is called (don't use the same name as the existing files) and upload to the WHMCS root directory. Almost done 2. Create another new file using your favourite text editor and paste your code into it. Then save that file into your theme directory that you are using as the same name you typed into the $templatefile variable with .tpl at the end. Thats it... Hope that helped 0 Quote Link to comment Share on other sites More sharing options...
selym Posted August 15, 2008 Author Share Posted August 15, 2008 Thank you Chicken and Sparky for taking the time to help. Still having a bit of trouble getting anything to show up. Here's what I did referring to both of your instructions. -Created new.php, pasted the code into it, and made sure file was in whmcs root directory, which is actually "whmcs" for this test. -Changed this line: $breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a> > <a href="mypage.php">My Page</a>'; require("init.php"); To this: $breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a> > <a href="new.php">New Page</a>'; require("init.php"); Then changed this line: $templatefile = "homepage"; To this: $templatefile = "new"; I saved the file, then copied the code and pasted it into a new file called new.tpl, saved it, and then uploaded it to whmcs/templates/portal, then browswed to mydomain.com/whmcs/new.php Still no luck getting a blank shell to show up. Do you see anything I've done wrong, or perhaps I missed something simple? I'm obviously not a programmer, but I hope I can crawl my way through this with your guidance. Thanks again to both of you for helping. Selym 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted August 15, 2008 Share Posted August 15, 2008 What are you using to create the file (What Program)? What is your url to your site? 0 Quote Link to comment Share on other sites More sharing options...
selym Posted August 15, 2008 Author Share Posted August 15, 2008 Originally I used notepad, but I also copied another existing page and renamed it to try that as well. Neither worked. Should I be using a specific program to create these files? Have PM'd you the url of my test site. Thanks, Selym What are you using to create the file (What Program)? What is your url to your site? 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted August 15, 2008 Share Posted August 15, 2008 I generally use either the editor built into CuteFTP or NotePad++ Have not received the PM yet 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted August 15, 2008 Share Posted August 15, 2008 Ahhh... I see what you have done wrong You created the new.php in WHMCS directory OK Then you created the new.tpl file, put it in the correct template directory - OK so far Then you pasted the same php code in new.tpl - this is were you went wrong In new.tpl goes your page content (html tags, text, images and stuff) Remove the contents of new.tpl and just type in <div style="text-align:center;font-size:20px;font-weight: bold;">Hello World.</div> Then save it. 0 Quote Link to comment Share on other sites More sharing options...
selym Posted August 15, 2008 Author Share Posted August 15, 2008 Ahh, ok, I just did what you said and the text is now showing up. Thanks for your help Steve. So perhaps I misunderstood what the "create a page" function does. I thought it would give me sort of an empty shell of a page in which I would have the navigation menu, header, footer, etc., which I could then add my own content to...but it would still look like a page that "belonged". Did I get the wrong idea, or is there still much to be done with this new page? Ahhh... I see what you have done wrong You created the new.php in WHMCS directory OK Then you created the new.tpl file, put it in the correct template directory - OK so far Then you pasted the same php code in new.tpl - this is were you went wrong In new.tpl goes your page content (html tags, text, images and stuff) Remove the contents of new.tpl and just type in <div style="text-align:center;font-size:20px;font-weight: bold;">Hello World.</div> Then save it. 0 Quote Link to comment Share on other sites More sharing options...
chickendippers Posted August 15, 2008 Share Posted August 15, 2008 That's exactly what it does, so just type the content into the tpl file! 0 Quote Link to comment Share on other sites More sharing options...
selym Posted August 15, 2008 Author Share Posted August 15, 2008 Hi chickendippers- Forgive me for not understanding completely, but do you mean type MY custom content into the tpl file, or the content/code such as the menu, header, footer, etc.? I'm just wondering at what point the "shell" is supposed to appear, because right now all I have is text (two words) from the steps I did above from Steve. Thanks, Selym That's exactly what it does, so just type the content into the tpl file! 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted August 15, 2008 Share Posted August 15, 2008 Your page that displays is basicly in 3 sections HEADER SECTION - displayed from header.tpl CONTENT SECTION - displayed in your example by new.tpl FOOTER SECTION - displayed from footer.tpl So yes your custom content goes into new.tpl 0 Quote Link to comment Share on other sites More sharing options...
chickendippers Posted August 15, 2008 Share Posted August 15, 2008 do you mean type MY custom content into the tpl fileYes indeed 0 Quote Link to comment Share on other sites More sharing options...
selym Posted August 16, 2008 Author Share Posted August 16, 2008 Okay, I started thinking I was beyond help because even after your last posts all I saw was the text, and none of the menus, header, footer, nothing. But then I realized my mistake. Somehow....I had the code swapped...what should have been in the php file was in the tpl file, and vice versa. So all is well now. Thank you both for helping. Very kind of you to help out. 0 Quote Link to comment Share on other sites More sharing options...
cyberneticos Posted August 15, 2009 Share Posted August 15, 2009 How can you remove the navigation menu on custom pages ? 0 Quote Link to comment Share on other sites More sharing options...
atmark Posted October 28, 2009 Share Posted October 28, 2009 Hello! I ask the help! I have created page and it was created normally. Now I wish to make processing of a code in PHP a file and result to give out in a variable for display in a pattern. I try to use a design $smartyvalues["variablename"] = "zzzz '; But at me nothing turns out...... How to me to catch a variable in TPL a file? And still a problem... $pageicon = "images/support/clientarea.gif"; - does not work. The picture does not show.... I used different ways, have read through a forum but have not found the answer!! There were changes for version 4.1.1?? And they are not described in the documentation? Thanks in advance! 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted October 29, 2009 Share Posted October 29, 2009 I try to use a design $smartyvalues["variablename"] = "zzzz '; But at me nothing turns out...... How to me to catch a variable in TPL a file? using your example above you will need to put {$variablename} into your tpl file for it to display. And still a problem... $pageicon = "images/support/clientarea.gif"; - does not work. The picture does not show.... The image is no longer in that directory... try this $pageicon = "images/clientarea.gif"; 0 Quote Link to comment Share on other sites More sharing options...
atmark Posted October 29, 2009 Share Posted October 29, 2009 $pageicon = "images/clientarea.gif"; - Does not work !!! Experimentally I have established, that it is necessary to specify - $pageicon = "clientarea"; It is strange... But works!!! 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted October 29, 2009 Share Posted October 29, 2009 Have you checked to make sure that the image is actually in the images directory? 0 Quote Link to comment Share on other sites More sharing options...
atmark Posted October 29, 2009 Share Posted October 29, 2009 Path - /templates/default/images/clientarea.png On the main page the same image shows!!! And on the, I could insert only having specified the NAME of a file, even without expansion. Other variants do not work! 0 Quote Link to comment Share on other sites More sharing options...
ProfitRamp Posted December 9, 2009 Share Posted December 9, 2009 i cant get the new page to show up. i am just getting a blank page. here is my sharedhosting.php file, saved in whmcs root <?php define("CLIENTAREA",true); require("dbconnect.php"); require("includes/functions.php"); $pagetitle = $_LANG['clientareatitle']; $pageicon = "images/support/clientarea.gif"; $breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a> > <a href="sharedhosting.php">Shared Hosting</a>'; require("init.php"); if ($_SESSION['uid']) { # User is Logged In - put any code you like here } # Define the template filename to be used without the .tpl extension $templatefile = "sharedhosting"; # To assign variables in Smarty use the following syntax. This can then be used as {$variablename} in the template $smartyvalues["variablename"] = $value; require("display.php"); ?> and here is my sharedhosting.tpl saved in /templates/portal/ <div style="text-align:center;font-size:20px;font-weight: bold;">TEST TEST</div> can anyone tell me what i am doing wrong 0 Quote Link to comment Share on other sites More sharing options...
ProfitRamp Posted December 10, 2009 Share Posted December 10, 2009 i got it figured out. i used the php file from this thread, which was from an older version. when i used the one from the wiki it worked first time. i didnt realize they were different. 0 Quote Link to comment Share on other sites More sharing options...
jojobojo Posted April 15, 2010 Share Posted April 15, 2010 Please sparky I need your help my WHMCS link is http://www.hostandeye.com/whmcs'>http://www.hostandeye.com/whmcs please i need to know how to add links inside the portal home to take me back to my website http://www.hostandeye.com please i can't do it myself i am very upset i tried for 15 days to do that and I couldn't help me please or make it for me if you can 0 Quote Link to comment Share on other sites More sharing options...
robb3369 Posted April 15, 2010 Share Posted April 15, 2010 (edited) You can simply use: <a href="/">Home Page</a> Add it to your header.tpl, footer.tpl, and/or the homepage.tpl template files... Edited April 15, 2010 by robb3369 Added locations 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted April 15, 2010 Share Posted April 15, 2010 Please sparky I need your help my WHMCS link is http://www.hostandeye.com/whmcs'>http://www.hostandeye.com/whmcs please i need to know how to add links inside the portal home to take me back to my website http://www.hostandeye.com please i can't do it myself i am very upset i tried for 15 days to do that and I couldn't help me please or make it for me if you can There are lots of others that can help you just as well as what I can. As rob3369 posted that will work by using relative urls / being relative to your public_html directory 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.