__fabrice Posted August 13, 2010 Share Posted August 13, 2010 I just wanted to know if I can create a module that will open in a separate page, a single page. Without using an hook.For example, in the footer, I have a link that will display using the module "blocklink" (blocklink.tpl actually)For the moment this module (blocklink) is using an "hookHome".We can do without here?, But the module will remain manageable of course.Thank you for your help.Fabrice Link to comment Share on other sites More sharing options...
rocky Posted August 13, 2010 Share Posted August 13, 2010 My free "Bought Products" module has a separate page that lists all bought products. You can download it to see how I did it. Link to comment Share on other sites More sharing options...
__fabrice Posted August 14, 2010 Author Share Posted August 14, 2010 Hi,Thank you. I look at your module, and I'll tell you if I had a question.Fabrice Link to comment Share on other sites More sharing options...
__fabrice Posted August 16, 2010 Author Share Posted August 16, 2010 Hi,I have some problems with your module :#1 : an js error in the ajax-cart.js, in the updateCart: function(jsonData) { }this alert shows : alert(errors + " updateCart:function : ");#2 in your module, you can configure only the hook, the block (hookRight).But I want to configure the page, in your case, bought-product.php (and .tpl) and not the blockboughtproductsnc.*For example, in the module "blocklink" I want to display, and configure, all the links in a separate page, NOT in a block (hook). It's possible ?Fabrice Link to comment Share on other sites More sharing options...
rocky Posted August 16, 2010 Share Posted August 16, 2010 Yes, the "bought products" page should still work without the block installed. The only thing you have to do is create a PHP file inside the module directory, then link to it. Link to comment Share on other sites More sharing options...
__fabrice Posted August 16, 2010 Author Share Posted August 16, 2010 yes, I understood that, and I done. But in the bought-product.php you can not use BLOCK_PRODUCTS_BOUGHT_NC_NUMBER or BLOCK_PRODUCTS_BOUGHT_NC_SORT variables. Isn't it?Fabrice Link to comment Share on other sites More sharing options...
rocky Posted August 16, 2010 Share Posted August 16, 2010 That's right. Those two variables are passed in to the block, but not the page, though you could add them in bought-products.php to make them accessible to the page. Link to comment Share on other sites More sharing options...
__fabrice Posted August 16, 2010 Author Share Posted August 16, 2010 Finaly, i find the answer.About the "blocklink" module, I simply create an another page (.php and .tpl), and I use the getLinks() function in my new php file. An so on. Quite simple. But i'm not sure that it can be applicable in the others modules...Thanks a lot.Fabrice Link to comment Share on other sites More sharing options...
rocky Posted August 16, 2010 Share Posted August 16, 2010 If your issue is resolved, please edit your first post and add [sOLVED] to the front of the title. Link to comment Share on other sites More sharing options...
__fabrice Posted August 17, 2010 Author Share Posted August 17, 2010 Yes, it's resolved, but the hook is displayed anymore. I just comment all the hookxxx functions and it's done. Thanks,Fabrice Link to comment Share on other sites More sharing options...
peanut Posted May 26, 2011 Share Posted May 26, 2011 Hi I'm trying to achieve the same thing, basically trying to get the jgalleryview 2 module to display in a separate page. Could you please tell me how you did it? I tried to download Rocky's module but it won't let me. It would help a lot if you could give me steps on how to make the module display on a page of its own since I'm not good at programming.Thanks Link to comment Share on other sites More sharing options...
kishanunjia Posted June 17, 2017 Share Posted June 17, 2017 Just create a controller with the name you want for the page, and put it in /overrides/controllers/front/. The name of the controller must be NameyouwantforthepageController.php Here is a basic class that will work: class MyPageController extends FrontController {/*** Initialize controller* @see FrontController::init()*/public function init() {parent::init();}/*** Assign template vars related to page content* @see FrontController::initContent()*/public function initContent() {parent::initContent();$this->setTemplate(_PS_THEME_DIR_.'my-page.tpl');}} Take a look at the FrontController to see what method you need to override to add functionnalities, for example setMedia() to add CSS / JS files. You will then be able to add a pretty url in the back office in the SEO panel. 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