Jump to content
gray

Configure Custom text blocks ? How do you change text height

Recommended Posts

 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.

Share this post


Link to post
Share on other sites

to what feature you reffer exactly?

can you point it on screen please?

Share this post


Link to post
Share on other sites

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) ?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

 

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?

Share this post


Link to post
Share on other sites

Just go to modules>modules & services>installed modules>theme moduels>custom text blocks.

Share this post


Link to post
Share on other sites
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 by sumsel
found third table, and changed behaviour

Share this post


Link to post
Share on other sites

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 by juchems

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More