archproject Posted October 28, 2010 Share Posted October 28, 2010 Hi there, does anybody know how to make the CMS show in thick box just like in the TERMS AND CONDITIONS in the shipping page of a purchase. where you need to put a check on the agree on terms and conditions. and when you click the link it shows in a thickbox Link to comment Share on other sites More sharing options...
rocky Posted October 28, 2010 Share Posted October 28, 2010 You will need to copy the code PrestaShop uses to enable thickbox into whatever files you need it on. Here's the code in product.php that enables thickbox: /* CSS ans JS files calls */ $css_files = array( __PS_BASE_URI__.'css/thickbox.css' => 'screen' ); $js_files = array( __PS_BASE_URI__.'js/jquery/thickbox-modified.js', __PS_BASE_URI__.'js/jquery/jquery.idTabs.modified.js', __PS_BASE_URI__.'js/jquery/jquery.scrollto.js', __PS_BASE_URI__.'js/jquery/jquery.serialScroll.js', _THEME_JS_DIR_.'tools.js', _THEME_JS_DIR_.'product.js' ); if (file_exists(_PS_THEME_DIR_.'thickbox.tpl')) $smarty->display(_PS_THEME_DIR_.'thickbox.tpl'); You will need to edit the appropriate PHP file for the page and add the thickbox.css, thickbox-modified.js and thickbox.tpl references. Once you've done that, you can add code like the following to the page's TPL: <a href="link_to_content" class="thickbox">link text Link to comment Share on other sites More sharing options...
dombloch Posted October 28, 2010 Share Posted October 28, 2010 Hi Rocky,I just tried to follow the steps you mentioned on this post but unfortunately my CMS pages didn't appear on a thickbox like Terms and Conditions during checkout.Could you please explain the different steps I need to do ?Thanks,Dominique Link to comment Share on other sites More sharing options...
archproject Posted October 28, 2010 Author Share Posted October 28, 2010 Rocky, Thanks but if you don't mind can you please give us an example file that we can use? like putting the above code to which file ? when you say appropriate PHP files... which one is the appropriate PHP file.... will i be able to put a youtube link and it will open up in a thickbox ? Link to comment Share on other sites More sharing options...
rocky Posted October 29, 2010 Share Posted October 29, 2010 If you explain exactly what you are wanting to do, it will be easier for me to be more specific. On which page do you want to display something in thickbox? Thickbox lets you display anything from another website in the content area. Link to comment Share on other sites More sharing options...
archproject Posted October 29, 2010 Author Share Posted October 29, 2010 Ok sorry for not explaining very well, I want to put a text link or image link in the Product page under the MORE INFO section to show a picture or a cms in thickboxlet's say in the MORE INFO tab I put CLICK HERE for more information when the customer clicks on CLICK HERE a CMS or a PICTURE or a YOUTUBE VIDEO will appear in a thickbox. Does that explain it ? Link to comment Share on other sites More sharing options...
rocky Posted October 29, 2010 Share Posted October 29, 2010 In that case, it is easy, since product page already includes thickbox for the product images. You just have to put a link like this in the product description: <a href="link_to_content" class="thickbox">Click here for more information Change link_to_content to the URL of the content you want to display in thickbox. 1 Link to comment Share on other sites More sharing options...
archproject Posted October 29, 2010 Author Share Posted October 29, 2010 Hahahah .. that was easy ... now how do i link a CMS to it ... because when I link a CMS link in the "LINK TO CONTENT" it shows my whole website with headers and all. I just want to display the CMS Link to comment Share on other sites More sharing options...
rocky Posted October 29, 2010 Share Posted October 29, 2010 You need to use a query string to display only the center column. For example, here's the "Terms and conditions" link (with friendly URL turned on):/content/3-terms-and-conditions-of-use?content_only=1&TB_iframe=true&width=450&height=500&thickbox=true 2 Link to comment Share on other sites More sharing options...
archproject Posted October 29, 2010 Author Share Posted October 29, 2010 You are using Friendly URL if no friendly url then it's like below correct ?Click here for more information But this didn't work Link to comment Share on other sites More sharing options...
rocky Posted October 29, 2010 Share Posted October 29, 2010 Not quite. It should be:/cms.php?id_cms=3&content_only=1&TB_iframe=true&width=450&height=500&thickbox=true Link to comment Share on other sites More sharing options...
archproject Posted October 29, 2010 Author Share Posted October 29, 2010 Great works like a charm ..... Thanks Rocky Link to comment Share on other sites More sharing options...
dombloch Posted October 29, 2010 Share Posted October 29, 2010 Hi guys,I still haven't managed to use thickbox on my CMS pages despite your guidelines.For instance, can you send screenshots of files or code to modify?I attach the cms.php (root) and cms.tpl (theme) son that you can advise and help.ThanksDominique Archive.zip Link to comment Share on other sites More sharing options...
rocky Posted October 30, 2010 Share Posted October 30, 2010 You put the code in the wrong place in cms.php. Try the following instead: <?php 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'); /* CSS ans JS files calls */ $css_files = array( __PS_BASE_URI__.'css/thickbox.css' => 'screen' ); $js_files = array( __PS_BASE_URI__.'js/jquery/thickbox-modified.js', ); if (file_exists(_PS_THEME_DIR_.'thickbox.tpl')) $smarty->display(_PS_THEME_DIR_.'thickbox.tpl'); $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'); ?> Link to comment Share on other sites More sharing options...
dombloch Posted October 30, 2010 Share Posted October 30, 2010 Hello Rocky,thanks for your screenshot as far as cms.php is concerned. I replaced my original cms.php with yours bu none of my CMS pages appear in a thickbox. Do you think I missed out something ? That seems weird !Here's my cms.tpl on my theme : {if !$content_only} {capture name=path}{l s=$cms->meta_title}{/capture} {include file=$tpl_dir./breadcrumb.tpl} {/if} {if $cms} {$cms->content} {else} {l s='This page does not exist.'} {/if} {if !$content_only} {l s='Home'} {/if} Shipping Legal notice Terms and conditions About us Secure payment Thanks again for your help,Dominique Link to comment Share on other sites More sharing options...
hulk Posted January 11, 2011 Share Posted January 11, 2011 hello I also want to display a page in CMS from an image in the module freeblock.I 've followed the instructions of Rocky: I put a link like this but it gives me the page without css and home page disappears. Then I added the following code in the page freeblock.php /* CSS ans JS files calls */ $css_files = array( __PS_BASE_URI__.'css/thickbox.css' => 'screen' ); $js_files = array( __PS_BASE_URI__.'js/jquery/thickbox-modified.js', ); but the left column disappears. Link to comment Share on other sites More sharing options...
kashifkhan112 Posted September 14, 2013 Share Posted September 14, 2013 Can i add this thickbox in any module like blockcms, blocknewsletter. 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