I hope I’ve picked the right place for this query and that someone is able to understand and confirm my thoughts please.
Just some context first – we have used a firm to create a website for us and they have used WordPress, have installed ACF and the Flexible Content Field add-on. They have also created a custom theme for us. It’s only 5 pages meant for information only. We are able to create new pages ourselves, are at a stage where we need to add a 6th page and want to do this ourselves.
Within ACF, have 3 Field Groups, with “Page Content” being the main one.
Within “Page Content” with have 4 fields, “Banner Image”, “Banner Headline”, “Banner Copy” and “Page Blocks” ( which is the flexible content field ).
Within “Page Blocks” we have 5 Layouts, with the main being “Content & Image Block”. This block uses a Text Area type for written content.
My query is : I want to create a new layout that uses the WYSIWYG type rather than a Text Area type. I’ve copied the “Content & Image Block”, named it “WYSIWYG Block” and changed the content field to WYSIWYG.
When I edit the new page I can access the WYSIWYG block but when I preview the page it doesn’t display the WYSIWYG block. If I copy the original “Content & Image Block” and try to use that, again, I can fill in the new fields but it doesn’t display the block when I preview the page.
Is the developer of our site able to configure it to stop us creating new layouts or do I just need to write a new JSON file to create this layout? I’ve checked and there doesn’t seem to be a maximum number set for layouts.
I hope I’ve explained this clearly.
Thank you to anyone who is able to answer my query.
The developer did not prevent you from creating new layouts. Each new layout must have corresponding code in your theme to display that layout.
Somewhere in the code of the theme there will be a call to the function
get_row_layout(). This call returns the layout name of the current layout in the flex field. This code will be followed by code created specifically for displaying the fields based on the layout name returned.
Different developers do this in different ways, but without adding the code for the layout the layout will just be ignored because the code does not know what to do with it.
Thank you John, that clears up my query.
Thanks for taking the time to explain, it’s appreciated.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
🎥👨💻 Join us today at the 2020 Online Page Builder Summit!— Advanced Custom Fields (@wp_acf) October 8, 2020
Interested in the future of WordPress? @elliotcondon kicks off today’s schedule with Rapid Block Type Development!
Build a bespoke, dynamic and powerful Block using PHP in just a few minutes!https://t.co/mAPTJpeu50 pic.twitter.com/4fRNvJjm8g
© 2020 Advanced Custom Fields. Subscribe