Jump to content

Repeater Item Headers when created via API


FuF
 Share

Recommended Posts

Hi there,

i have a ProFields Repeater Matrix called "Empfaenger" - with two fields "vorname" & "nachname" and for the Item headers {vorname} {nachname} set.
When i create a new "Empfaenger" via the Backend - ist correctly shows me the values of the two fields "vorname" & "nachname".
But when i create a new "Empfaenger" via the API :

$empfaenger = $page->empfaenger->getNew();
$empfaenger->vorname = "Hulk";
$empfaenger->nachname = "Hogan";
$page->save();

The Item header is something like 1. None/undefined ᛫ Showing fields for all types... 
See attached screenshot. Why ist that? And how can i avoid this?

Thanks & Cheers 
Simon

Repeater-Item-Headers.png

Link to comment
Share on other sites

Okay i managed to solve the Problem. I found this thread and modified my code:

$empfaenger = $page->empfaenger->getNew();
$empfaenger->repeater_matrix_type = 1;
$empfaenger->vorname = "Hulk";
$empfaenger->nachname = "Hogan";
$page->save();

Defining the repeater_matrix_type did the trick!

Cheers
Simon

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...