Hi,
I’m using this 3rd Party Plugin () which enables SO Builder as a ACF field.
Everything works fine, but (only) the headline widget does not render completely (only renders the wrapper).
I tested around and found, if I have the same content in a post as the content, it works fine.
So I would like to render the content from the custom field with the SO engine.
I figured something like this could work:
$mycustomcontent = SiteOrigin_Panels::renderer()->render( false, true, get_field('acf_page_builder_field',$postid) );
But this gives me nothing.
Here is what is in the database for the field “acf_page_builder_field”. It looks like it is not serialized. Can this be an issue.
It works for all other widgets, except the headline.
{"widgets":[{"title":"","text":"testtext","filter":"on","visual":"on","panels_info":{"class":"WP_Widget_Text","raw":true,"grid":0,"cell":0,"id":0,"widget_id":"f005cfbd-259a-49e5-b8dc-98301431f975","style":{"id":"","class":"","widget_css":"","mobile_css":"","margin":"","padding":"","mobile_padding":"","background":"","background_image_attachment":"0","background_image_attachment_fallback":"","background_display":"tile","border_color":"","font_color":"","link_color":""}}},{"headline":{"text":"testheadline","destination_url":"","tag":"h1","color":"","hover_color":"","font":"default","font_size":"","font_size_unit":"px","align":"center","line_height":"","line_height_unit":"px","margin":"","margin_unit":"px","so_field_container_state":"open"},"sub_headline":{"text":"","destination_url":"","tag":"h3","color":"","hover_color":"","font":"default","font_size":"","font_size_unit":"px","align":"center","line_height":"","line_height_unit":"px","margin":"","margin_unit":"px","so_field_container_state":"closed"},"divider":{"style":"solid","color":"#EEEEEE","thickness":"1","align":"center","width":"80","width_unit":"%","margin":"","margin_unit":"px","so_field_container_state":"closed"},"order":"headline,divider,sub_headline","fittext_compressor":"0.85","_sow_form_id":"9376360355fb3bfcc23ce1124410706","_sow_form_timestamp":"1605615578243","panels_info":{"class":"SiteOrigin_Widget_Headline_Widget","raw":true,"grid":0,"cell":0,"id":1,"widget_id":"3ba39ee6-d0f5-4feb-9a5c-cfeab4851ab8","style":{"id":"","class":"","widget_css":"","mobile_css":"","margin":"","padding":"","mobile_padding":"","background":"","background_image_attachment":"0","background_image_attachment_fallback":"","background_display":"tile","border_color":"","font_color":"","link_color":""}}}],"grids":[{"cells":1,"style":{}}],"grid_cells":[{"grid":0,"index":0,"weight":1,"style":{}}]}
Maybe someone can give me a hint in the right direction to render this the right way! :)
Thanks Sascha
Hey, I dug deeper into this.
I managed to get the general rendering done:
The issue might be because the plugin I use (forgot to link in the above post): https://wordpress.org/plugins/acf-page-builder-field/
saves the widget configs as json and not serialized data?
I’m puzzled why it works for all widgets except headline. Maybe the way it works with the template file in the headline directory?
/widgets/headline/tpl/default.php
Thanks for every 2 Cent you can spare ;)
Hi Sascha,
The code you’ve provided looks fine to me. The render method $panels_data parameter should be non-serialized data so what you’re doing is correct.
Can you please provide me with an export of your layout? This will allow me to run some tests using it. You can do this by opening your the page builder button and click the layout button in the Page Builder toolbar. Then click import/export and then click download. Please upload the export to a 3rd party file hosting site such as WeTransfer (no email is required).
Kind regards,
Alex
Hi Aley,
you looking into this is very much appreciated! :)
https://we.tl/t-mHzz5ucUce
Here is an example of the layout I have in the ACF page builder field. Everything looks great except the headline widget on the very top of the layout. The html at that instance is like this:
Which looks like it does not render the innerpart. :(
Best regards Sascha
Hi Sascha,
Thanks. I’ve had a look over the provided layout and I don’t see any issues with that should prevent it from rendering.
Do any errors get logged when you attempt to render the layout?
Kind regards,
Alex
I have an error in the php log. But this might be related to something else.
2020/11/19 14:41:44 [error] 28121#28121: *205047 FastCGI sent in stderr: “PHP message: PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘create_post_type_html5’ not found or invalid function name in /var/www/web/wp-includes/class-wp-hook.php on line 287PHP message: PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘enable_threaded_comments’ not found or invalid function name in /var/www/web/wp-includes/class-wp-hook.php on line 289” while reading response header from upstream, client: 93.133.184.49, server: mydomain.de, request: “GET /folder/angebottest/?angebot=8047 HTTP/2.0”, upstream: “fastcgi://unix:/var/lib/php7.0-fpm/web849.sock:”, host: “www.mydomain.de”
BTW, the page in question is here:
https://www.meinfernsehen.de/m7-test/angebottest/?angebot=8047
The missing headline is right below the top slider.