Jump to content

[MODULE] Blocks - Add fully customizable content, wherever you want!


Kaudaj

Recommended Posts

Discover the infinite Blocks experience.


logo.png.1949d0729a2f48715f5474ef6b580de1.png  TRY IT NOW!

 

 

=> Why blocks?

A banner, a slider, a text... What are all these things? Content blocks.

Natively, you can display them through one dedicated module for each of them: ps_banner, ps_imageslider, ps_customtext. But they have a major problem: flexiblity.
For each "block type", you have one module, one configuration, one block per hook. Who hasn't thought of duplicating these modules?

Here comes the idea to make a module that allows you to add multiple independent blocks.
Each one has its own type, own options, own location.

 

=> And page builders?

Page builders have more or less the same goal. I would say it's still a matter of advantages and disadvantages.
Of my own experience, I would sum up like this:

Advantages of page builders

  • More user-friendly
  • Directly usable in the front-office

Advantages of kjblocks

  • Lighter render, much less superfluous HTML code
  • Very extensible and configurable
  • Made exclusively for PrestaShop: optimized, multistore, consitent interfaces, maintained

I'm working on the user-friendly aspect, but this module will probably never be as user-friendly as the page builders.
It's maybe not even the goal. The goal is mainly to keep it simple, optimized and flexible.

 

=> Extensions

This module is free and can be extensible by any developer for specific needs. It means that anyone can add their own block types with through the extensions concept.

If you're a developer, check out the extension example on GitHub.

If you're not developer or/and you have common needs, you can buy directly the official extensions on PrestaShop Addons to add new types to your collection:

Not available yet, coming soon...

 

=> Download

 

=> Useful links

 

=> Changelog

  • 1.1.1: PS 1.7.8 backward compatibility
  • 1.1.0: PS 8.0 compatibility
  • 1.0.0: First release
Edited by Kaudaj
Add version 1.1.1 (see edit history)
  • Like 2
Link to comment
Share on other sites

En 13/5/2023 a las 4:49 PM, Kaudaj dijo:

Discover the infinite Blocks experience.


logo.png.1949d0729a2f48715f5474ef6b580de1.png  TRY IT NOW!

 

 

=> Why blocks?

A banner, a slider, a text... What are all these things? Content blocks.

Natively, you can display them through one dedicated module for each of them: ps_banner, ps_imageslider, ps_customtext. But they a major problem: flexiblity.
For each "block type", you have one module, one configuration, one block per hook. Who hasn't thought of duplicating these modules?

Here comes the idea to make a module that allows you to add multiple independent blocks.
Each one has its own type, own options, own location.

 

=> And page builders?

Page builders have more or less the same goal. I would say it's still a matter of advantages and disadvantages. Of my own experience, I would sum up like this:

Advantages of page builders

  • More user-friendly
  • Directly usable in the front-office

Advantages of kjblocks

  • Lighter render, much less superfluous HTML code
  • Very extensible and configurable
  • Made exclusively for PrestaShop: optimized, multistore, consitent interfaces, maintained

I'm working on the user-friendly aspect, but this module will probably never be as user-friendly as the page builders.
It's maybe not even the goal. The goal is mainly to keep it simple, optimized and flexible.

 

=> Extensions

This module is free and can be extensible by any developer for specific needs. It means that anyone can add their own block types with through the extensions concept.

If you're a developer, check out this extension example on GitHub: [link].

If you're not developer or/and you have common needs, you can buy directly the official extensions on Addons to add new types to your collection:

Not available yet, coming soon...

 

=> Download

 

=> Useful links

 

=> Changelog

  • 1.0.0: First release

readme_en.pdf 365.96 kB · 4 downloads

Works perfectly on PS 1.7.8.X

You can make it compatible with PS 8.0.X or PS 8.1.X

Thank you so much.

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, DNK-LUIFER said:

Works perfectly on PS 1.7.8.X

You can make it compatible with PS 8.0.X or PS 8.1.X

Thank you so much.

Thanks for your reply!

I was just thinking about this subject.
I'll make all my modules compatible to 8.X in the week. However, it will probably imply that the upgrades will not be longer compatible with 1.7.X, because 8 is a major version and brings many breaking changes.

  • Thanks 1
Link to comment
Share on other sites

What is exactly your use case? Should the user be able to enter his own PHP code in BO and the server would run it?
If this is what you want to do, you could create a "PHP" block type which would use the eval method.

However, as everyone agrees, this method is dangerous and not recommended. I would recommend creating a dedicated block type yourself (if you're a developer) and adding options to adjust the display rather than letting the merchant do the coding part (at least for PHP, HTML/JS can be considered though).
If you decide to use eval method anyway, be sure to add a validation because merchant will probably save crashy code sometimes.

In any case, you will have to develop your own Blocks extension.
Official extensions will be released but at the moment, there are only two block types (text and container). Text type will not run php code, it will only accept html code.
Moreover, I'm not sure to add this kind of block in an official extension, as it's too tricky for merchant and not safe enough.

Edited by Kaudaj (see edit history)
Link to comment
Share on other sites

Hi @Kaudaj,

I just tested it and it's work like charm! (PS 1.7.8).

Did you schedule to have option for select wich products or category you can apply a block ? Goal will be to have a different text depend of category for instance. (see screenshot).

Ie:

Product select:
Block 1 -> id_product1, id_product2 ..

Category select:
Block 2 -> Category 1, Subcategory11, Subcategory12

Brand select .....

Regards,

 

 

 

 

 

 

Edited by prestaconfig
picture small (see edit history)
  • Like 1
Link to comment
Share on other sites

Hi @prestaconfig,

Thanks for your feedback.

This is not planned for kjblocks itself but I note this feature for a future extension. I already planned to do an extension about product blocks and these options can be indeed interesting.
But if you're in a hurry, any developer (or you) can code this. In fact, the main goal of this module is to be super extensible, so any developer can add the block type he needs!

Link to comment
Share on other sites

  • 3 weeks later...

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
×
×
  • Create New...