Berik Posted November 21, 2010 Share Posted November 21, 2010 Hi, I'm a total prestashop newb so sorry if these questions seem stupid I'm seriously considering using PS for an small upcoming client site mainly for it's simple multilanguage support.What I'm trying to achieve is to have a cms page as the homepage by default, a few subsequent cms pages and finally the store itself. If you were to look at the navigation it would look something like this:Home | About | News | Store• So my first question obviously is: how do i set a static cms page as homepage?• Second issue I'm trying to figure out is how to remove the "/content/" part of the SEF url for the cms pages?• Last issue: what plugin/module could I use to have a simple news/blog-like system? Doesn't need to be a full blown wordpress type of thing, just a simple way for my client to post news articles and let visitors comment them, and have a way of displaying them as a list on a page. I already tried Eihwaz's free news modules (found here) but that's already too complicated as I don't need categories and there is no tab in the backoffice.My client is not tech-saavy and really needs something simple and straigthforward. I'm not necessarelly searching for a free system (althought I wouldn't mind^^). It just needs to work without me having to spend countless hours hacking it! Thanks in advance for any help you can bring! Link to comment Share on other sites More sharing options...
Berik Posted November 21, 2010 Author Share Posted November 21, 2010 Well I answered question 3 all by myself > just had to remove (uninstall) the categories module Other 2 questions still open though! Link to comment Share on other sites More sharing options...
rocky Posted November 26, 2010 Share Posted November 26, 2010 For the first question: Copy cms.php into index.php and then adding the ID of the CMS page to the top should work. Replace index.php in the root directory of PrestaShop with the following: <?php $_GET['id_cms'] = 3; include(dirname(__FILE__).'/config/config.inc.php'); //will be initialized bellow... if(intval(Configuration::get('PS_REWRITING_SETTINGS')) === 1) $rewrited_url = null; include(dirname(__FILE__).'/init.php'); if (($id_cms = intval(Tools::getValue('id_cms'))) AND $cms = new CMS(intval($id_cms), intval($cookie->id_lang)) AND Validate::isLoadedObject($cms)) { /* rewrited url set */ $rewrited_url = $link->getCmsLink($cms, $cms->link_rewrite); include(dirname(__FILE__).'/header.php'); $smarty->assign(array( 'cms' => $cms, 'content_only' => intval(Tools::getValue('content_only')) )); $smarty->display(_PS_THEME_DIR_.'cms.tpl'); include(dirname(__FILE__).'/footer.php'); } else Tools::redirect('404.php'); ?> Change 3 at the top to the ID of the CMS page.For the second question: You can't remove /content/ since PrestaShop requires it to distingish between categories and CMS pages. You can, however, change it from "content" to something else. To do that, edit your .htaccess file and change "content" to something else like "page", then edit the getCMSLink() function in classes/Link.php and change "content" to "page" there too. Link to comment Share on other sites More sharing options...
Berik Posted November 29, 2010 Author Share Posted November 29, 2010 Thank you for your input Rocky, I really appreciate it. Will get on to try that ASAP! Link to comment Share on other sites More sharing options...
Lucas-911 Posted March 1, 2011 Share Posted March 1, 2011 Hello, hows your website coming along? Will be great to see it as I'm in the process of a similar project. Will be great to know what modules you used....Cheers Link to comment Share on other sites More sharing options...
steviger Posted May 24, 2011 Share Posted May 24, 2011 @Rocky,Could you be slightly more elaborate? Do I understand it correctly if :I take the code from root/cms.php and paste this above the code in root/index.php ?Then take your code and paste this in root/index.php and overwrite it, I really don't get it....Or should I just paste your code and overwrite the index.php?Cheers,Steven Link to comment Share on other sites More sharing options...
rocky Posted May 24, 2011 Share Posted May 24, 2011 Copy the entire cms.php file into index.php, replacing everything in that file, then add the following below the <?php: $_GET['id_cms'] = 3; Change 3 to the ID of the CMS page you want displayed as the homepage. 1 Link to comment Share on other sites More sharing options...
steviger Posted May 24, 2011 Share Posted May 24, 2011 I get it. Works like a charm! In fact I'm looking for the same solution as Berik does. Home | About | News | StoreSo start of with some CMS pages (I get that now) but when you click on Store you should see the page with featured products and stuff, like the "normal" frontpage. Any tips?Thanks again.Steven Link to comment Share on other sites More sharing options...
mani313 Posted June 7, 2013 Share Posted June 7, 2013 For the first question: Copy cms.php into index.php and then adding the ID of the CMS page to the top should work. Replace index.php in the root directory of PrestaShop with the following: <?php $_GET['id_cms'] = 3; include(dirname(__FILE__).'/config/config.inc.php'); //will be initialized bellow... if(intval(Configuration::get('PS_REWRITING_SETTINGS')) === 1) $rewrited_url = null; include(dirname(__FILE__).'/init.php'); if (($id_cms = intval(Tools::getValue('id_cms'))) AND $cms = new CMS(intval($id_cms), intval($cookie->id_lang)) AND Validate::isLoadedObject($cms)) { /* rewrited url set */ $rewrited_url = $link->getCmsLink($cms, $cms->link_rewrite); include(dirname(__FILE__).'/header.php'); $smarty->assign(array( 'cms' => $cms, 'content_only' => intval(Tools::getValue('content_only')) )); $smarty->display(_PS_THEME_DIR_.'cms.tpl'); include(dirname(__FILE__).'/footer.php'); } else Tools::redirect('404.php'); ?> Change 3 at the top to the ID of the CMS page. For the second question: You can't remove /content/ since PrestaShop requires it to distingish between categories and CMS pages. You can, however, change it from "content" to something else. To do that, edit your .htaccess file and change "content" to something else like "page", then edit the getCMSLink() function in classes/Link.php and change "content" to "page" there too. I Have a Query How do i get shop page (old hom page) if i change default index.php? 1 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