I contribute to the translation of WordPress and its documentation into French.
π You can read me on my blog : https://mariecomet.fr/blog/
WordPress plugin makes it possible to save the ACF flexible content fields as templates
I contribute to the translation of WordPress and its documentation into French.
π You can read me on my blog : https://mariecomet.fr/blog/
What about some updates?
After upgrading ACF Pro to version 5.7.0, there is a new javascript error in the admin:
"Uncaught TypeError: acf.ajax.extend is not a function".
This issue is with line 8 of mc-acf-ft-template.js.
This javascript error makes a lot of things in the Wordpress admin broken.
When upgrading the the newest ACF the ACF Templates turn into one large text field instead of the normal flexible content fields (Screenshot Below)
. This also breaks things on the front-end. I'm unsure of the exact cause, but here is the link to the ACF release: https://www.advancedcustomfields.com/blog/acf-5-7-11-release/ .
Please help with this as soon as you can.
Love the plugin and would like to keep using it!
Describe the bug
In the file \mc-acf-flexible-template\assets\js\mc-acf-ft-template.js
line:195
:
The code acf.do_action( 'validation_begin' );
is incorrect, as it's not providing form.$el
as it should. This can lead to errors if other plugins hook on validation_begin
expecting a parameter.
For reference, here is the original hook by ACF:
File: \advanced-custom-fields-pro\assets\js\acf-input.js
line:13043
acf.doAction('validation_begin', this.$el);
To fix the issue:
acf.do_action( 'validation_begin' );
should be replaced by:
acf.doAction('validation_begin', $form);
Regards.
Great work on the plugin!
I noticed that when saving templates, they can have the same name, e.g. if you save a template 'Test' you can then save another template 'Test'. Is it possible to give an alert to the user if saving a template that already has that name (or append a number to the template name)?
ACF template helps me translating complex flexible field contents from one site to another one.
Describe the solution you'd like
I'd like to be able to export/import a template from one WordPress instance to another.
It'd only include attached images if importer was told so at the time of import.
Describe alternatives you've considered
Since ACF templates are custom post types. I thought standard tools would support it out of the box.
This results in a new ACF template :
Additional context
Templates are mostly stored in a _flex_layout_data
which is serialized.
But "here is the point" : the serialized form is not "installation-independant". It's probably related to why imported templates are shown as empty.
Hi, is there an easy way to display a saved template through PHP like echo mc_acf_import_template($templateID)
?
Hey I have been using your plugin for a while now and it is awesome, thank you for your hard work!
I have changed a few things with how my content is captured in the backend and I have run into an issue.
The main part of my content is a flexible content field where I can add sections. One of the sections also contains a flexible content field with in it that I add more sub sections.
When I save the main section flexible content items as a template, the inner flexible content fields become messed up and breaks the content.
The image above shows the saved flexible content template. As you can see the 'Page Content' field is a flexible content field has the 'Columns' Flexible Content field, with two items assigned. The layout and content is saving to the ACF Template CPT correctly.
The image above shows what happens when I import the saved template back into the Page Content Flexible Content area. As you can see the inner Flexible Content field that contains the two Wysiwyg Editor fields has duplicated. It appears the whole inner Flexible Content field has duplicated as you can see two "Add Column" buttons in it.
I hope you understand my issue. I love using your plugin. If you know how we can fix this issue and help is much appreciated.
Thanks in advanced, Peter
Describe the bug
Stopped working with ACF 5.10
To Reproduce
The "Save template" tooltip containing Name the template : *
does not show the name
text input anymore.
WordPress and ACF Versions
WordPress version :
ACF version: 5.10
ACF Pro version: 5.10
The reason is that acf_render_field_label
now uses acf_esc_html()
which strips the necessary markup.
When a flexible content field is loaded in to another group via ACF's built-in clone
field the plugin struggles to load or save templates for the given field.
clone
fieldComponent Selector (all fields)
I'd expect to see the load/save buttons above each "component" (which I do!) and be able to, well.... use them. That is, to be able to save and then load any given component layout as a template.
The "actual behavior" when I try to save one of my component's is to give a bit of vague messaging (see screenshot) and then nothing... nor does the template get added to the "ACF Templates" tab...
This is probably a pretty complex/inane ACF setup βΒ the plugin works great in the simpler scenarios I tested! Still,Β it'd be very useful for me in this particular instance. So if you do have a chance to work out this kink it'd be much appreciated. (Happy to help if/where I can...)
v4.9.6
v5.7.0
v2.1.0
v2.1.0
Hi Marie,
Today, I discovered your plugin, and it is what I always needed since I use the flexible content a lot.
I found some cases when the "Load template" and "Save template" buttons are not displayed.
When the Field Group has more than one field type, for example, a text field and then a flexible content:
for case 1
I looked at the class MC_Acf_Flexible_Template, and I added to the actions the type=clone
// add option settings in flexible field
add_action( 'acf/render_field_settings/type=flexible_content', array( $this, 'mc_ft_acf_field_groups_add_settings' ), 10, 1 );
// add option settings in flexible field clone
add_action( 'acf/render_field_settings/type=clone', array( $this, 'mc_ft_acf_field_groups_add_settings' ), 10, 1 );
But I couldn't find how to display the save buttons.
Carlos
Hey, your plugin is so great but I got a question : why don't you add a system to duplicate layouts ?
Because your plugin already allows to import a same layout several times in a row, which is certain way of a duplication. With this option in addition I would buy that plugin without hesitation.
Think about getting rich ;)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.