peterp Posted June 19, 2021 Posted June 19, 2021 Hi All, I have created a new document in admin>file manager>documents and what I want to do is have this new document appear in the home page which I realize I can do by checking the home page radio button but unfortunately this then removes the original home page document. Is there a way that I can have 2 home page documents. I have moved the original home page to display above the logo on the Mican template but obviously when I check the home page radio button in the documents of the new document that I have created this then appears above the logo. So would it possible to have the original homepage document to appear above the logo and then the new document that we have created appear in the original position on the home page at the same time Hope somebody can help. Best Regards, Peterp
bsmither Posted June 19, 2021 Posted June 19, 2021 You can create a snippet using the hook named class.cubecart.display_homepage, and for the PHP code, use a slightly modified version of the code that gets the Homepage document: <?php if (($home = $this->getDocument(99)) !== false) { $GLOBALS['smarty']->assign('DOCUMENT_ALT', array( 'title' => $home['doc_name'], 'content' => $home['doc_content'], 'hide_title' => $home['hide_title'] )); } You will need to know the the 'doc_id' of the alternate homepage document (replace 99), and in the Mican skin: Replace: {if isset($DOCUMENT)} <div id="announcement"> <h1>{$DOCUMENT.title}</h1> {$DOCUMENT.content} </div> {/if} With: {if isset($DOCUMENT_ALT)} <div id="announcement"> <h1>{$DOCUMENT_ALT.title}</h1> {$DOCUMENT_ALT.content} </div> {/if}
peterp Posted June 23, 2021 Author Posted June 23, 2021 Hi Brian, I have tried this code and on one of the locally hosted version of the cubecart when I try to save the snippet all I get is a blank screen and it doesn't go back to the admin screen. I decided to try it on another machine which is using the same cubecart version and it all worked perfectly. what could be the cause of the blank screen happening when i try to save the snippet. Hope you can Help, Peterp
bsmither Posted June 23, 2021 Posted June 23, 2021 Let's see if the error_log has any clues. https://forums.cubecart.com/topic/51550-how-to-create-the-error-log/
peterp Posted June 23, 2021 Author Posted June 23, 2021 Hi Brian, No error log has been created. I have checked the version of PHP is 7.3 Where now Best Regards, Peterp
bsmither Posted June 23, 2021 Posted June 23, 2021 Do you have your web server (as opposed to PHP) configured to write errors to a web server error log?
peterp Posted June 23, 2021 Author Posted June 23, 2021 Hi Brian, Thankyou for helping me with this issue. I'm currently using xampp (as localhost) so I'm not really sure how to configure a web server to write error log sorry for my lack of knowledge. If you can instruct me as to what I have to do I'm sure I can make it happen Best Regards, Peterp
peterp Posted June 23, 2021 Author Posted June 23, 2021 hi Brian, I think I have fixed it. I uninstalled xampp and then reinstalled it and then did all of the mods again and it seems to have worked. Thanks again for all of your help I appreciate it immensely. Best Regards, Peterp
bsmither Posted June 24, 2021 Posted June 24, 2021 According to this site: https://www.atechtown.com/xampp-control-panel/ this is what you would use to view the various XAMPP log files.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.