poliquinp Posted June 15, 2017 Share Posted June 15, 2017 Hello, I tried to look arround before posting but it did not helped me. I have created a new page named « games.php » where I do some sorts for custom queries and custom texts. But when it comes to change the language with the original language switcher, it does not work. I have to go back on the homepage, switch the language and return on games.php to see my changes. In the header, I use those lines of code <ul class="nav-lang"> <li><a href="{$currentpagelinkback}language=english" data-lang="en"><img src="templates/{$template}/img/svg/english.svg" class="svg" alt="English" width="24" /> En</a></li> <li><a href="{$currentpagelinkback}language=french" data-lang="en"><img src="templates/{$template}/img/svg/french.svg" class="svg" alt="French" width="24" /> Fr</a></li> <li><a href="{$currentpagelinkback}language=german" data-lang="en"><img src="templates/{$template}/img/svg/german.svg" class="svg" alt="German" width="24" /> De</a></li> </ul> As I say, it works great on defaults .php pages. Here is my custom games.php code (Almost copied all the code explained on the main documentation -> https://developers.whmcs.com/advanced/creating-pages/ ) <?php use WHMCS\Database\Capsule; //define("CLIENTAREA", false); //define("FORCESSL", false); require("init.php"); $ca = new WHMCS_ClientArea(); $ca->setPageTitle("Our games"); $ca->addToBreadCrumb('index.php', Lang::trans('globalsystemname')); $ca->addToBreadCrumb('games.php', 'Our games'); $ca->initPage(); //$ca->requireLogin(); // Uncomment this line to require a login to access this page # To assign variables to the template system use the following syntax. # These can then be referenced using {$variablename} in the template. $games = array(); foreach (Capsule::table('tblproductgroups')->where('id', '>', '3')->where('hidden', '=', '0')->orderBy('order', 'asc')->get() as $group) { foreach (Capsule::table('tblproducts')->where('gid', '=', $group->id)->get() as $game) { $games[$group->id]['games'][] = $game; } $games[$group->id]['details'] = $group; } $ca->assign('games', $games); Menu::addContext(); Menu::primarySidebar('announcementList'); Menu::secondarySidebar('announcementList'); # Define the template filename to be used without the .tpl extension $ca->setTemplate('games'); $ca->output(); 0 Quote Link to comment Share on other sites More sharing options...
husnain11221 Posted July 16 Share Posted July 16 I've created a new page named games.php where I handle some custom queries and texts. However, I've encountered an issue with the language switcher. It doesn't change the language directly on games.php. Instead, I need to go back to the homepage, switch the language there, and then return to games.php to see the changes. 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.