BWT Posted June 14, 2012 Share Posted June 14, 2012 (edited) Hello, I need a little help setting up a new back office tab. I wanted to add a new tab to the back office so that I can quickly go to the settings of my blog module. I have found a few other posts about this however when I tried to do it the first time I totally broke the site, after fixing everything I tried again with undesirable results again. So I am reaching out to the community for a better understanding of how to do this, I know from my searches that I am not the only one who wishes to understand this in a detailed way so I figured I would try and post about this process. Please break down the steps to make this happen I appreciate your time many thanks ahead of time. How to create a new BO TAB with a modules configure settings in the tab?? Edited July 13, 2012 by tjg (see edit history) Link to comment Share on other sites More sharing options...
BWT Posted July 13, 2012 Author Share Posted July 13, 2012 Never mind I figured it out myself ! 1 Link to comment Share on other sites More sharing options...
girlsgirl12 Posted July 20, 2012 Share Posted July 20, 2012 I want to do this too, having a difficult time doing it. can you help?? Please send me a private message thanks. Link to comment Share on other sites More sharing options...
ovom Posted August 6, 2012 Share Posted August 6, 2012 Hello, I want to do this too. Be so good and write your solution! Thx a lot! Link to comment Share on other sites More sharing options...
BWT Posted August 6, 2012 Author Share Posted August 6, 2012 In the back office go to Employees> tabs>new tab> Then you need to fill out the fields, if your connecting the tab to a already installed module you will need to add the correct names, if you connecting to a new page one will need to be created such as admin>tabs>AdminMyTabPage.php and configured accordingly on he new tab fields. Link to comment Share on other sites More sharing options...
ovom Posted August 6, 2012 Share Posted August 6, 2012 I connected module EDITORIAL, the tab was created, but it is not working. Link to comment Share on other sites More sharing options...
Aldi M Posted October 12, 2012 Share Posted October 12, 2012 @ovom: If you go to your module's configuration page, you will see in the address bar the details required for the input fields (see attached image below). The 'controller' will be the CLASS and the 'configure' will be the MODULE. However, I'm currently using Prestashop 1.5.1 and there seems to be a bug, in that the MODULE field doesn't seem to work. So my workaround is to fill the CLASS field with both the controller and the module like so: AdminModules&configure=slideric PS: The settings for Prestashop 1.5.1 is under Administration > Menus 1 Link to comment Share on other sites More sharing options...
kelvz Posted November 5, 2012 Share Posted November 5, 2012 (edited) I do that but it says Invalid security token Edited November 5, 2012 by kelvz (see edit history) Link to comment Share on other sites More sharing options...
Aldi M Posted November 5, 2012 Share Posted November 5, 2012 @kelvs Yes, the same thing happens if you create a 'Quick Access' link from the 'Administration' menu for back office shortcuts. In the "Quick Access > Add Menu" page, there's even an instruction as follows: "If it's an URL that comes from your Back Office, you must NOT put a security token." Meaning, I assume, that if you were to create a back office shortcut, you were not supposed to include the security token in the URL, thus the security warning. So I guess since we created the links ourselves and we know what we were doing, it should be save. Just click on the "I understand the risks and I really want to display this page" and you should be good to go. 2 Link to comment Share on other sites More sharing options...
[email protected] Posted March 5, 2013 Share Posted March 5, 2013 @Aldi M i want to add tab in catalog in BO using module. can u explain me step by step process please..... Thanks Link to comment Share on other sites More sharing options...
wodzienka Posted May 15, 2013 Share Posted May 15, 2013 I was searching the solution to security token warning and kinda found something. It is not "professional", but I got rid of this horrible "invalid token" warning in BO tabs I created myself (thanks to @Aldi M's instructions above). Now the button "I understand the risk..." clicks itself So, what I did was: 1. in admin/themes/default/template/invalid_token.tpl just after <head> I added: <script type="text/javascript"> function init(){ var linkPage = document.getElementById('dynLink').href; window.location.href = linkPage; } onload=init; </script> 2. In the same file I added the id="dynLink" to <a href="{$url}" method="get" style="float:left;background: #E3E3E3;border-color: #CCCCCC #BBBBBB #A0A0A0;border-left: 1px solid #BBBBBB;border-radius: 3px 3px 3px 3px;border-right: 1px solid #BBBBBB;border-style: solid;border-width: 1px;color: #000000;margin: 20px 10px;padding:10px;text-align:center;vertical-align:middle;"> so it looks like this now: <a href="{$url}" id="dynLink" method="get" style="float:left;background: #E3E3E3;border-color: #CCCCCC #BBBBBB #A0A0A0;border-left: 1px solid #BBBBBB;border-radius: 3px 3px 3px 3px;border-right: 1px solid #BBBBBB;border-style: solid;border-width: 1px;color: #000000;margin: 20px 10px;padding:10px;text-align:center;vertical-align:middle;"> The solution is based on this thread: http://www.webdeveloper.com/forum/showthread.php?97081-Auto-click-a-link-Please-help! 3 Link to comment Share on other sites More sharing options...
brandonc503 Posted May 18, 2013 Share Posted May 18, 2013 hey. same issue. trying to get configure links for modules on other pages with correct token. i see all the config links have same token. how would i call that? Ive found. if (Tools::getValue('redirect') == 'config' && Tools::getValue('module_name') != '' && $return == '12' && Module::isInstalled(pSQL(Tools::getValue('module_name')))) Tools::redirectAdmin('index.php?controller=adminmodules&configure='.Tools::getValue('module_name').'&token='.Tools::getValue('token').'&module_name='.Tools::getValue('module_name').$params); Tools::redirectAdmin(self::$currentIndex.'&conf='.$return.'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name).(isset($modules_list_save) ? '&modules_list='.$modules_list_save : '').$params); <a href="{$url}" method="get" style="float:left;background: #E3E3E3;border-color: #CCCCCC #BBBBBB #A0A0A0;border-left: 1px solid #BBBBBB;border-radius: 3px 3px 3px 3px;border-right: 1px solid #BBBBBB;border-style: solid;border-width: 1px;color: #000000;margin: 20px 10px;padding:10px;text-align:center;vertical-align:middle;"> {l s='I understand the risks and I really want to display this page'} </a> <div class="row-actions-module"> {if !isset($module->not_on_disk)}{$module->optionsHtml}{else} {/if} </div> is the code for the modules links, ie config delete reset... Link to comment Share on other sites More sharing options...
brandonc503 Posted May 18, 2013 Share Posted May 18, 2013 @ovom: If you go to your module's configuration page, you will see in the address bar the details required for the input fields (see attached image below). The 'controller' will be the CLASS and the 'configure' will be the MODULE. However, I'm currently using Prestashop 1.5.1 and there seems to be a bug, in that the MODULE field doesn't seem to work. So my workaround is to fill the CLASS field with both the controller and the module like so: AdminModules&configure=slideric PS: The settings for Prestashop 1.5.1 is under Administration > Menus how do you get the token part right? i noticed all the modules' delete configure delete.. have the same token... so to make a link right to the configure of the module. how do i call that correct token? Link to comment Share on other sites More sharing options...
vekia Posted May 18, 2013 Share Posted May 18, 2013 how do you get the token part right? i noticed all the modules' delete configure delete.. have the same token... so to make a link right to the configure of the module. how do i call that correct token? you can get token from $_GET[''] variable - both for controller (php script) and for template (smarty code $smarty.get) Link to comment Share on other sites More sharing options...
shovonbugs Posted June 3, 2014 Share Posted June 3, 2014 I was searching the solution to security token warning and kinda found something. It is not "professional", but I got rid of this horrible "invalid token" warning in BO tabs I created myself (thanks to @Aldi M's instructions above). Now the button "I understand the risk..." clicks itself So, what I did was: 1. in admin/themes/default/template/invalid_token.tpl just after <head> I added: <script type="text/javascript"> function init(){ var linkPage = document.getElementById('dynLink').href; window.location.href = linkPage; } onload=init; </script> 2. In the same file I added the id="dynLink" to <a href="{$url}" method="get" style="float:left;background: #E3E3E3;border-color: #CCCCCC #BBBBBB #A0A0A0;border-left: 1px solid #BBBBBB;border-radius: 3px 3px 3px 3px;border-right: 1px solid #BBBBBB;border-style: solid;border-width: 1px;color: #000000;margin: 20px 10px;padding:10px;text-align:center;vertical-align:middle;"> so it looks like this now: <a href="{$url}" id="dynLink" method="get" style="float:left;background: #E3E3E3;border-color: #CCCCCC #BBBBBB #A0A0A0;border-left: 1px solid #BBBBBB;border-radius: 3px 3px 3px 3px;border-right: 1px solid #BBBBBB;border-style: solid;border-width: 1px;color: #000000;margin: 20px 10px;padding:10px;text-align:center;vertical-align:middle;"> The solution is based on this thread: http://www.webdeveloper.com/forum/showthread.php?97081-Auto-click-a-link-Please-help! This solution is good but not permanent solution...would be better if we will get permanent solution... Link to comment Share on other sites More sharing options...
varen Posted December 28, 2014 Share Posted December 28, 2014 This solution is good but not permanent solution...would be better if we will get permanent solution... Works great! Link to comment Share on other sites More sharing options...
bbgun91 Posted July 16, 2015 Share Posted July 16, 2015 The Quick Access link to the module config works great ! It's a good solution. Also, i didn't have any Token error notification. I'm on Prestashop 1.4.10. Cheers, Ray Link to comment Share on other sites More sharing options...
gonssal Posted February 10, 2016 Share Posted February 10, 2016 Casually landed in this topic, and have a couple of minutes to explain my solution. Create a new tab that links to one of your module's admin controllers (for example MyModulePreferencesController). In the Preferences admin controller's class, just define the init() class, call parent::init() and do a redirect: Tools::redirectAdmin($this->context->link->getAdminLink('AdminModules') . '&configure=' . Tools::safeOutput($this->module->name)); Link to comment Share on other sites More sharing options...
navneetccna Posted March 25, 2016 Share Posted March 25, 2016 (edited) what is the final solution ? javascript is working but there should be another way to manage id Edited March 25, 2016 by navneetccna (see edit history) Link to comment Share on other sites More sharing options...
xaxa Posted October 24, 2016 Share Posted October 24, 2016 Casually landed in this topic, and have a couple of minutes to explain my solution. Create a new tab that links to one of your module's admin controllers (for example MyModulePreferencesController). In the Preferences admin controller's class, just define the init() class, call parent::init() and do a redirect: Tools::redirectAdmin($this->context->link->getAdminLink('AdminModules') . '&configure=' . Tools::safeOutput($this->module->name)); Hello, Can you give a complete code of controller's class please? Thanks Link to comment Share on other sites More sharing options...
gonssal Posted October 26, 2016 Share Posted October 26, 2016 Hello, Can you give a complete code of controller's class please? Thanks Can't you read? class AdminPreferencesController extends ModuleAdminController { /** * @see AdminController->init(); */ public function init() { parent::init(); // Just redirect to the module configuration page Tools::redirectAdmin($this->context->link->getAdminLink('AdminModules') . '&configure=' . Tools::safeOutput($this->module->name)); } } 2 Link to comment Share on other sites More sharing options...
xaxa Posted October 27, 2016 Share Posted October 27, 2016 Can't you read? class AdminPreferencesController extends ModuleAdminController { /** * @see AdminController->init(); */ public function init() { parent::init(); // Just redirect to the module configuration page Tools::redirectAdmin($this->context->link->getAdminLink('AdminModules') . '&configure=' . Tools::safeOutput($this->module->name)); } } Thanks Link to comment Share on other sites More sharing options...
Jluis Posted September 5, 2018 Share Posted September 5, 2018 @vekia here is my module privateshop , It haven't any adminController , how could i do n order to get new tab in admin area for that module privateshop.zip Link to comment Share on other sites More sharing options...
Jluis Posted September 10, 2018 Share Posted September 10, 2018 the problem is solved now by adding adminController to the module Link to comment Share on other sites More sharing options...
carlos.batista Posted March 10, 2020 Share Posted March 10, 2020 thats work fine . Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now