SHIROKO Posted January 16, 2015 Share Posted January 16, 2015 Hello all, How can I set a CMS page as homepage on prestashop 1.6 please ? Link to comment Share on other sites More sharing options...
vekia Posted January 16, 2015 Share Posted January 16, 2015 hello perhaps this will meet your requirements?https://www.prestashop.com/forums/topic/245898-module-cms-page-content-on-homepage-free/ Link to comment Share on other sites More sharing options...
SHIROKO Posted January 17, 2015 Author Share Posted January 17, 2015 Hi vekia, Thanks for your input. Looks like the module adds the contrent of a cms page into my homepage.What i'd like is to define a CMS page as home page The idea behind this is to have a "traditionnal website" with a shop, the menu would look like this : Index / Home page (cms page) / About us (cms page) / Contact us / Shop (Prestashop index page) Is it possible ? Link to comment Share on other sites More sharing options...
vekia Posted January 17, 2015 Share Posted January 17, 2015 if you want to create a cms page as a shop homepage - it is possible but only with controller modification. for example, we have CMS page with ID 4. and we want to use it as a homapge. go to: controllers/front/IndexController.php replace contents of this file with: <?php /* * 2007-2015 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2015 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ class IndexControllerCore extends FrontController { public $php_self = 'cms'; public $assignCase; public $cms; public $cms_category; public $ssl = false; public function canonicalRedirection($canonicalURL = '') { if (Tools::getValue('live_edit')) return; if (Validate::isLoadedObject($this->cms) && ($canonicalURL = $this->context->link->getCMSLink($this->cms, $this->cms->link_rewrite, $this->ssl))) parent::canonicalRedirection($canonicalURL); elseif (Validate::isLoadedObject($this->cms_category) && ($canonicalURL = $this->context->link->getCMSCategoryLink($this->cms_category))) parent::canonicalRedirection($canonicalURL); } /** * Initialize cms controller * @see FrontController::init() */ public function init() { parent::init(); } public function setMedia() { parent::setMedia(); if ($this->assignCase == 1) $this->addJS(_THEME_JS_DIR_.'cms.js'); $this->addCSS(_THEME_CSS_DIR_.'cms.css'); } /** * Assign template vars related to page content * @see FrontController::initContent() */ public function initContent() { parent::initContent(); $id_cms=4; $this->cms = new CMS($id_cms, $this->context->language->id); $this->context->smarty->assign(array( 'cms' => $this->cms, 'content_only' => (int)Tools::getValue('content_only'), 'path' => $path, 'body_classes' => array($this->php_self.'-'.$this->cms->id, $this->php_self.'-'.$this->cms->link_rewrite) )); $this->setTemplate(_PS_THEME_DIR_.'cms.tpl'); } } you can find there code: $id_cms=4; just change value of this variable to display another cms page. (4 is a id of cms page) 1 Link to comment Share on other sites More sharing options...
SHIROKO Posted January 18, 2015 Author Share Posted January 18, 2015 Hi Vekia, it works great tyvm ! But now, how would I make a link to old index in my horizontal menu ? Index (cms page) / About us (cms page) / Contact us (cms page) / Visit our Shop (Prestashop index page) I'd like a traditional website to present our company + a store (as catalog). Cheers Link to comment Share on other sites More sharing options...
vekia Posted January 18, 2015 Share Posted January 18, 2015 hello i don't understand this part, or it's to obious for me ;-) you just simply want to create "home" link that will redirect to homepage (cms page) ? Link to comment Share on other sites More sharing options...
freelance-web Posted December 7, 2015 Share Posted December 7, 2015 (edited) Hello Ambassadors, y was looking for a script like this one to remplace the traditional index by a CMS page. Work good I use prestashop 1.6.1.3 Any solution? Best regards Edited January 3, 2016 by lestyx (see edit history) Link to comment Share on other sites More sharing options...
freelance-web Posted January 3, 2016 Share Posted January 3, 2016 (edited) First of all Happy New Year! I understand the issue of Kuroko and indeed I have the same question. After you change the default home page with your sript to a CMS page, how to create a link in the menu pointing to the home page by default of prestashop, not the cms home page ? I am clear !!!! Edited January 3, 2016 by lestyx (see edit history) 1 Link to comment Share on other sites More sharing options...
vekia Posted January 4, 2016 Share Posted January 4, 2016 just type url to your shop front office main page and this should be enough to create "homepage" menu item Link to comment Share on other sites More sharing options...
freelance-web Posted January 4, 2016 Share Posted January 4, 2016 (edited) I expressed myself badly, sorry. My question is: before the change of "IndexController.php" the index of my site was the home page the default index page off prestashop, after editing the file "IndexController.php" how can I call home page the default index page off prestashop? not the new cms page creating a second "IndexController.php" as IndexController2.php ??? Edited January 4, 2016 by lestyx (see edit history) Link to comment Share on other sites More sharing options...
emilyoct Posted September 8, 2016 Share Posted September 8, 2016 (edited) I am having same questions as well. Thank you to vekia, I got the cms page as homepage now, but I lost the old default homepage link, can you please help, what should I do to get the old default homepage to become the Shop menu button link please? just type url to your shop front office main page and this should be enough to create "homepage" menu item Edited September 8, 2016 by emilyoct (see edit history) Link to comment Share on other sites More sharing options...
mansour codes Posted June 14, 2020 Share Posted June 14, 2020 I have the same question how to create a prestashop with this menu Home (cms page) / About us (cms page) / Contact us (cms page) / Visit our Shop (Prestashop index page) I thinks the request as very clear However I find something usefull but I could not apply it 😕 Here: https://www.brontobytes.com/knowledgebase/202/.htaccess-URL-Masking-Examples.html?language=english¤cy=7 Quote Example 1 #Show content from a different path on the same domain #This way each time someone accesses yourdomain.com/path the actual content that will be displayed will be for yourdomain.com/different/path while the URL will remain unchanged. RewriteEngine On RewriteRule ^path/?$ /different/path/ Example 2 #Redirect and keep everything after the URL #Visit yourdomainA.com/page and it will show the content from yourdomainB.com/page RewriteEngine On RewriteCond %{HTTP_HOST} ^yourdomainA.com RewriteRule ^(.*) http://www.yourdomainB.com/$1 [P] Can any one apply it ? 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