gray Posted November 9, 2016 Share Posted November 9, 2016 Configure Custom text blocks ? How do you change text height as there is no menu item. Ok you can go into the code, but thats not right. any ideas plz PS v1.7.0.0.0 official release. Link to comment Share on other sites More sharing options...
vekia Posted November 9, 2016 Share Posted November 9, 2016 to what feature you reffer exactly? can you point it on screen please? Link to comment Share on other sites More sharing options...
gray Posted November 11, 2016 Author Share Posted November 11, 2016 Hi - its the Custom text blocks module - configuration page. The page you type in all the text and insert images. Also not mentioned - But how do you add a 2nd Custom text block, as it does say blocks (plural) ? Link to comment Share on other sites More sharing options...
rocky Posted November 27, 2016 Share Posted November 27, 2016 I've reported this issue in the Betas and RCs, but PrestaShop decided not to allow multiple text blocks to be configured, even though the blocks are stored in a separate database table. I managed to hack a solution by changing line 256 of modules/ps_customtext/ps_customtext.php from: 'cms_infos' => Db::getInstance()->getRow($sql), to: 'cms_infos' => Db::getInstance()->executeS($sql), and modules/ps_customtext/ps_customtext.tpl from: <div id="custom-text"> {$cms_infos.text nofilter} </div> to: {foreach from=$cms_infos item=cms_info} <div id="custom-text"> {$cms_infos.text nofilter} </div> {/foreach} I can then add multiple blocks one after the other, but I must manually add new rows to the ps_info and ps_info_lang tables in the database. It really would be better for PrestaShop to create a list of blocks on the configuration page that can be edited, but they've ignored my requests so far. Link to comment Share on other sites More sharing options...
JoeSchiaffi Posted June 14, 2017 Share Posted June 14, 2017 I'm having the same problem, It's really weird that with Presta 1.7 they disabled the possibility to have more custom blocks as it was before on 1.6 v Link to comment Share on other sites More sharing options...
mr_absinthe Posted August 13, 2017 Share Posted August 13, 2017 I've reported this issue in the Betas and RCs, but PrestaShop decided not to allow multiple text blocks to be configured, even though the blocks are stored in a separate database table. I managed to hack a solution by changing line 256 of modules/ps_customtext/ps_customtext.php from: 'cms_infos' => Db::getInstance()->getRow($sql), to: 'cms_infos' => Db::getInstance()->executeS($sql), and modules/ps_customtext/ps_customtext.tpl from: <div id="custom-text"> {$cms_infos.text nofilter} </div> to: {foreach from=$cms_infos item=cms_info} <div id="custom-text"> {$cms_infos.text nofilter} </div> {/foreach} I can then add multiple blocks one after the other, but I must manually add new rows to the ps_info and ps_info_lang tables in the database. It really would be better for PrestaShop to create a list of blocks on the configuration page that can be edited, but they've ignored my requests so far. Hi, I've tried in 1.7.2 as you suggested, inserted lines in the database, however I cannot see list of blocks anywhere therefore I'm unable to edit the second block. Can you have two blocks on home page? Or better ... is this hack working in 1.7.2? Link to comment Share on other sites More sharing options...
DICE Posted July 1, 2018 Share Posted July 1, 2018 Just go to modules>modules & services>installed modules>theme moduels>custom text blocks. Link to comment Share on other sites More sharing options...
sumsel Posted November 13, 2018 Share Posted November 13, 2018 (edited) On 14/08/2017 at 4:48 AM, mr_absinthe said: Hi, I've tried in 1.7.2 as you suggested, inserted lines in the database, however I cannot see list of blocks anywhere therefore I'm unable to edit the second block. Can you have two blocks on home page? Or better ... is this hack working in 1.7.2? I tried this in 1.7.4.3. PS_Customtext version 4.1.0 Added a test text entry in the database in these tables (prefix)info_lang (prefix)info I noticed there is a third table related to this module: (prefix)info_shop I didn't modify this one. Then: Modified the files as described by rocky. 'cms_infos' => Db::getInstance()->getRow($sql) this is now in row 290 of customtext.php, replaced as indicated with this 'cms_infos' => Db::getInstance()->executeS($sql), For customtext.tpl: <div id="custom-text"> {$cms_infos.text nofilter} </div> This is the only entry really in this file, replaced as indicated by rocky to {foreach from=$cms_infos item=cms_info} <div id="custom-text"> {$cms_infos.text nofilter} </div> {/foreach} There was a change, but not the one I wanted. Backoffice: I don't get the list of those two info blocks. The module will automatically reload to the custom text block no. 1. When clicking "back to list", it will shortly display a list only displaying this one item, and then automatically reload the edit page for this one item. Same issue as mr_absinthe. Hint from DICE appears not useful. However: In frontoffice now I suddently had my info block replicated. I suddently had the same custom text 4 times instead of once. I did not get the test info block which I had created in the database, but only a copy of the original text I had written through backoffice. My shop has 5 languages, maybe the modification rocky proposed is designed for a shop with one language. Only a wild guess. I deleted the new database entries and nothing changed. Still the info block was replicated three times. All in the same language, I didn't get the translations, just four times the same text block. I reverted back to the original version. For me it doesn't seem to work unfortunately. Edited November 13, 2018 by sumsel found third table, and changed behaviour (see edit history) Link to comment Share on other sites More sharing options...
juchems Posted February 11, 2019 Share Posted February 11, 2019 (edited) Can someone from Prestashop that this is the desired functionality for this module? It's been half baked since v1.7 launch? I am on 1.7.4.2 with Module version 4.1.0 and this appears useful only to put a block of text on the homepage as it is shown. The back to list button does nothing. https://github.com/PrestaShop/PrestaShop/issues/9902 Looks like it is "Major" outstanding bug at this time, but was submitted back in October 2017. I don't have the skills to contribute to fixing it, sadly... Edited February 11, 2019 by juchems (see edit history) Link to comment Share on other sites More sharing options...
num47 Posted January 30, 2021 Share Posted January 30, 2021 Can anyone tell me how to duplicate this module so that i can put a second custom text block on my home page. Thanks Link to comment Share on other sites More sharing options...
Prestachamps Posted January 30, 2021 Share Posted January 30, 2021 @num47 could you please stop spamming the forum. You opened the same question 5 times. I understood this is important for you, and modules can be duplicated (we usually do for payment modules), however this creates also certain other issues, like having 2 JS with the same name, sharing class, etc. If it's something you can avoid rather buy substitute module for it. The duplicate holds several steps. 1. You need to duplicate the module using FTP 2. You change the parameters of the modules : like the name, which needs to be match with the modulesname.php! You change the name of the class, the name of the module ($ this-> name), the display name ($ this-> displayName) and the path to the view file: 3. You need to check all the values saved into the DB, and change those. (bear in mind that changing the DB tables is not always needed) 4. You change the parameters for the translation. Once this steps have been done- you should be able to have a module duplicate. Bear in mind that this depends from the module you would like to duplicate. The steps described above are a ruff approach as we don't know what module you would like to duplicate. Last point. just stop spamming the forum... I hope I helped, cheers, Leo 1 Link to comment Share on other sites More sharing options...
hardik12 Posted February 2, 2023 Share Posted February 2, 2023 On 11/13/2018 at 9:43 AM, sumsel said: I tried this in 1.7.4.3. PS_Customtext version 4.1.0 Added a test text entry in the database in these tables (prefix)info_lang (prefix)info I noticed there is a third table related to this module: (prefix)info_shop I didn't modify this one. Then: Modified the files as described by rocky. 'cms_infos' => Db::getInstance()->getRow($sql) this is now in row 290 of customtext.php, replaced as indicated with this 'cms_infos' => Db::getInstance()->executeS($sql), For customtext.tpl: <div id="custom-text"> {$cms_infos.text nofilter} </div> This is the only entry really in this file, replaced as indicated by rocky to {foreach from=$cms_infos item=cms_info} <div id="custom-text"> {$cms_infos.text nofilter} </div> {/foreach} There was a change, but not the one I wanted. Backoffice: I don't get the list of those two info blocks. The module will automatically reload to the custom text block no. 1. When clicking "back to list", it will shortly display a list only displaying this one item, and then automatically reload the edit page for this one item. Same issue as mr_absinthe. Hint from DICE appears not useful. However: In frontoffice now I suddently had my info block replicated. I suddently had the same custom text 4 times instead of once. I did not get the test info block which I had created in the database, but only a copy of the original text I had written through backoffice. My shop has 5 languages, maybe the modification rocky proposed is designed for a shop with one language. Only a wild guess. I deleted the new database entries and nothing changed. Still the info block was replicated three times. All in the same language, I didn't get the translations, just four times the same text block. I reverted back to the original version. For me it doesn't seem to work unfortunately. not work Link to comment Share on other sites More sharing options...
ps8modules Posted February 2, 2023 Share Posted February 2, 2023 (edited) Hi, and what doesn't work for you Please express yourself with your own description without clicking on the quote. It is good to attach pictures of what is involved. Text height? The module contains an editor in which you can format the text as you need. It is polite to say hello, thank you and not be afraid to use the word "please". Edited February 2, 2023 by ps8moduly.cz (see edit history) 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