howto figure out newly created pod_id's
Hi,
I'm building a system for internal use, to create static html pages, for translation purposes etc.
I created a publicform with some fields like name, title, upload form for html-file and excel-file (which has all translation, line per line in a column).
With helpers I strip the content apart and the html-structure and do some more processing on the data. The HTML-structure is then used to build the new pages, per country and per language (e.g. page_xxx_fr_be, for French speaking Belgium for instance).
The project is saved in one pod (project) and all translations in a pod translations. I have a Bi-directional PICK field in both pods to make a relation between a project and it's translations..
But how to know the pod_id of the project, in the pre- or postsave helper.. ? So I can save that when I save the translations with $api->save_pod_item($transl_params); This happens in the post-save helper btw.
2 Answers
$params->tbl_row_id and $params->pod_id are available for your use.
Thx Scott.
$lp_project_id = $params->tbl_row_id;
$transl_params = array('datatype' => 'translations',
'columns' => array(
'name' => $podname_translation,
'slug' => $slug_translation,
'country' => $country_val,
'translated_html'=> $testhtml,
'testxlsarray'=> $testxls,
'lp_project' => $lp_project_id
)
);


