Kian Posted May 1, 2010 Share Posted May 1, 2010 Hello. From documentation. Every page of WHMCS is a combination of 3 templates header.tpl The Page Template footer.tpl "The Page Template" is everyting you can find inside your WHMCS (clientareahome.tpl, announcements.tpl, knowledgebase.tpl). My question is very simple. How can i take "The Page Template" without header and footer? I have to include or iframe a part of my WHMCS in a website but i don't need header and footer. How can i exclude them? 0 Quote Link to comment Share on other sites More sharing options...
thehost5968 Posted May 1, 2010 Share Posted May 1, 2010 So are you saying you want to use all the files that come within WHMCS but just without the Header and Footer? If so do you still need to use WHMCS direct if not then you could have blank header and footer. but you you do need WHMCS direct then look at putting a else if statement in the header and footer files. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted May 3, 2010 Author Share Posted May 3, 2010 (edited) Thank you for reply No, it's more simple i don't want to use all the files of WHMCS. I don't even need any of its features. I have a custom page (php & tpl) that simply makes a query in WHMCS database and show results. It's a public page. Login, cookie, function and variabiles of WHMCS are not reqired, I have to include() or iframe this page on external website that's why i need to disable header and footer. I'm going to use header and footer of the external website. I know that i can skip this problem with a bit of coding but i really don't want to spend time on it. Edited May 3, 2010 by Kian 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted May 4, 2010 WHMCS Support Manager Share Posted May 4, 2010 You can't disable header.tpl and footer.tpl, but can empty out the files to remove the design. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted May 4, 2010 Author Share Posted May 4, 2010 Uhm... tpl is empty (html tables only) so i have to edit the related php file. It's the review.php module <?php require("dbconnect.php"); require("includes/functions.php"); require("includes/clientareafunctions.php"); $pagetitle = "Reviews"; $pageicon = "images/support/clientarea.gif"; $breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a> > <a href="reviews.php">Reviews</a>'; initialiseClientArea($pagetitle,$pageicon,$breadcrumbnav); function HTMLKAC($value) { $value = str_replace("<", "<", $value); $value = str_replace(">", ">", $value); return $value; } function uc_first($str){ $str[0] = strtr($str, "abcdefgh�ijklmnopqrstuvwxyz". "\x9C\x9A\xE0\xE1\xE2\xE3". "\xE4\xE5\xE6\xE7\xE8\xE9". "\xEA\xEB\xEC\xED\xEE\xEF". "\xF0\xF1\xF2\xF3\xF4\xF5". "\xF6\xF8\xF9\xFA\xFB\xFC". "\xFE\xFF", "ABCDEFGHI�JKLMNOPQRSTUVWXYZ". "\x8C\x8A\xC0\xC1\xC2\xC3\xC4". "\xC5\xC6\xC7\xC8\xC9\xCA\xCB". "\xCC\xCD\xCE\xCF\xD0\xD1\xD2". "\xD3\xD4\xD5\xD6\xD8\xD9\xDA". "\xDB\xDC\xDE\x9F"); return $str; } $yorumlar = @mysql_query("SELECT userid, yorum, soyadgoster, emailgoster, tarih FROM mod_yorumlar WHERE onay='1' ORDER BY tarih DESC"); $row_yorumlar = @mysql_fetch_assoc($yorumlar); $totalRows_yorumlar = @mysql_num_rows($yorumlar); $i = 0; if($totalRows_yorumlar > 0) { do { $row_musteri = mysql_fetch_assoc(mysql_query("SELECT firstname, lastname, email FROM tblclients WHERE id='".$row_yorumlar['userid']."'")); if($row_yorumlar['soyadgoster'] == 1) { $isim = uc_first($row_musteri['firstname'])." ".uc_first($row_musteri['lastname']); } else { $isim = uc_first($row_musteri['firstname']); } if($row_yorumlar['emailgoster'] == 1) { $email = "<a href='mailto:".$row_musteri['email']."'>".$row_musteri['email']."</a>"; } else { $email = "<i>Hidden</i>"; } $yorum = HTMLKAC($row_yorumlar['yorum']); $tarih = $row_yorumlar['tarih']; $yorumlari[$i]['isim'] = $isim; $yorumlari[$i]['yorum'] = $yorum; $yorumlari[$i]['email'] = $email; $yorumlari[$i]['tarih'] = date("d.m.Y", $tarih); $i++; } while($row_yorumlar = mysql_fetch_assoc($yorumlar)); } if ($_SESSION['uid']) { # User is Logged In - put any code you like here } # To assign variables in Smarty use the following syntax. # This can then be used as {$variablename} in the template $smartyvalues["yorumlari"] = $yorumlari; # Define the template filename to be used without the .tpl extension $templatefile = "reviews"; outputClientArea($templatefile); ?> It's based on your tpl customization. I don't understand what part i have to remove to delete header and footer 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted May 6, 2010 Author Share Posted May 6, 2010 I've solved my problem with a simple smarty {if} in tpl. Header and footer template remain hidden in my custom page only. 0 Quote Link to comment Share on other sites More sharing options...
jquintana Posted July 18, 2010 Share Posted July 18, 2010 Can you explain what you did? I want to do something similar. Thanks! 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted July 20, 2010 Author Share Posted July 20, 2010 I used IF function with page title. Let's suppose that i have Reviews page (review.php & review.tpl). Page title is "Reviews". I want to hide header for this WHMCS page. Let's open header.tpl. We have something similar: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset={$charset}" /> <title>{$companyname} - {$pagetitle}{if $kbarticle.title} - {$kbarticle.title}{/if}</title> {if $systemurl}<base href="{$systemurl}" /> {/if}<link rel="stylesheet" type="text/css" href="templates/{$template}/style.css" /> <script type="text/javascript" src="includes/jscript/jquery.js"></script> </head> <body> [ the rest of the page ] [ the rest of the page ] [ the rest of the page ] [ the rest of the page ] Simply add IF function: {if $pagetitle eq "Reviews"} {else} <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset={$charset}" /> <title>{$companyname} - {$pagetitle}{if $kbarticle.title} - {$kbarticle.title}{/if}</title> {if $systemurl}<base href="{$systemurl}" /> {/if}<link rel="stylesheet" type="text/css" href="templates/{$template}/style.css" /> <script type="text/javascript" src="includes/jscript/jquery.js"></script> </head> <body> [ the rest of the page ] [ the rest of the page ] [ the rest of the page ] [ the rest of the page ] I get $pagetitle. If $pagetitle is "Reviews" stop showing the content of the page else show everyting. Examples: I visit knowledgebase.php. Is page title "Reviews"? No. Show everything. I visit announcements.php?id=12. Is page title "Reviews"? No. Show everyting. I visit reviews.php. Is page title "Reviews"? Yes. Show only the content between {if $pagetitle eq "Reviews"} and {else} (in my case nothing). 0 Quote Link to comment Share on other sites More sharing options...
jquintana Posted July 20, 2010 Share Posted July 20, 2010 Thanks - I will look over this later and try to implement it on my site. 0 Quote Link to comment Share on other sites More sharing options...
DrLightman Posted March 13, 2013 Share Posted March 13, 2013 Yes. Show only the content between {if $pagetitle eq "Reviews"} and {else} (in my case nothing). You should terminate the header.tpl file with {/if}, it's not clear if you did it or not from your examples 0 Quote Link to comment Share on other sites More sharing options...
disgruntled Posted March 14, 2013 Share Posted March 14, 2013 I dont see a reason for this to be fair. look at it this way, If you want all the pages across your website to have a unified design then the three template system is ideal. Headers Body Footer It saves replication of code across many files, this means you save disk space. If you decide to move everything into the body section of the website then that means every body template needs to contain a complete webpage. The only reason i could possibly conceive of you wanting to be doing this is that you are calling up the installation from another website using their header and footer and using your white label installation to run many hosting companies. Thats an idea of course but not one i would want to do. If that were the way in which you wanted to do it, then you could just create those header and footer files for those sites within the installation, you would simply need to run a check to see what domain is calling up the installation. It would also allow you to keep the installation intact and looking good for anybody that happens to come along to the installation website. 0 Quote Link to comment Share on other sites More sharing options...
tfs Posted March 19, 2013 Share Posted March 19, 2013 It think that you forget that 90% of "real" installations is using whmcs only for billing and back office. Sure 100's of startups is trying to make a functional website of it but realistically you are very restricted in what you can do with it. 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.