Closed Schwankenson closed 6 months ago
I would probably put the fields in a method inside of a Trait that accepts/handles the array and then use that trait's method to add the fields to the builder.
I have a bigger update started for ACF Composer to make some of this stuff (hopefully) a lot nicer, but no ETA right now.
Great!
I now ended up in adding the parameters to the fields function of the partials:
public function fields($bootstrap_class_prefix="pb", $field_name_postfix="pb", $conditional_logic=[])
{
(...)
}
Then I render it like this:
$partialClass = new BootstrapSpacingClasses($this->app);
$renderedPartialFieldsSizeClassPb = $partialClass->fields("abc", "def");
And put it to the block with
->addFields($renderedPartialFieldsSizeClassPb)
That works great and does exactly what I want.
Hi, I would like to add a partials multiple time with different field name. I think the
$this->get function
fromInteractsWithPartial
trait would need a second parameter where you can pass a assoziative array which can then be used for field generation.Or is this possible in another way?
What I would do with it: I have a complex partial which contains 3 fields, and I would like to add it multiple times to one block. But not as repeater.