• Priority: 0
  • Status: Closed
  • Theme: Alysum
  • Assigned To: Fred
  • Private: No
  • Open Date: 06.04.20, 20:46
  • Opened by: Julien
  • Closed by: Fred
  • Closed on: 08.05.20, 00:49
  • Reason: Closed
  • Comment: Glad to help!

Ticket #17245 - Displaying a hook within an HTML block in the Page Builder

Dear Alysum team,

We are trying to display a module on our home page via your Layout Builder. When we add the code to the HTML block to be displayed ({hook h=’displayPrestaBlogList’ id=’1’ mod=’prestablog’}), the Layout Builder does not interpret the code as Smarty code, but translates it into a <span>, and the home page then displays “{hook h=’displayPrestaBlogList’ id=’1’ mod=’prestablog’}” instead of the actual hook content.

Is there a way to display the hook content by using the HTML blocks of the Layout Builder?

Thanks in advance,

Best regards,

Julien

Comments

Fred 06 Apr 2020, 22:29

Hi, Julien.
it’s impossible.
You have to add a hook directly into the code

Julien 07 Apr 2020, 03:40

Alright, so which code should I modify exactly, i.e. which .tpl file is storing the information of the homepage in your Layout builder?

Thank you,

julien

Fred 07 Apr 2020, 11:46

it depends on place where you want to have it

Julien 07 Apr 2020, 14:07

Hi Fred,

If you look at our homepage (https://bioseb2.idtech-vitrolles.com/index.php), you’ll see where the code “{hook h=’displayPrestaBlogList’ id=’1’ mod=’prestablog’}” is currently displayed (under the featured products).

The template we use (and modified) in the Layout Builder is “Dailydeal”. Is the Layout Builder saving the template as a tpl file somewhere?

Which file/code should we modified in order to add the code above to the home page?

Thanks in advance for your help,

Best regards,

Julien

Fred 08 Apr 2020, 11:52

Try following trick
- Add a widget Blog Posts to your layout
- open the file /modules/pspagebuilder/views/templates/front/widgets/widget_blogposts.tpl
- remove all content there and add only your hook