1283 Posts
Bucklash
8 years ago
Topic

Hi Sebloders

I understand that I can use a field like AFTERSTORE to dynamically create another piece of content.

I am able to create content for tables:
#__content
and
#__cck_store_form_my_content_type
BUT
I am ignorant and unable to populate
#__cck_store_item_content

The code I would use to create an article is like this. Have I missed something obvious?

$newArticle = new JCckContent( 
    array('joomla_article') 
);
$addArticle = $newArticle->create(
    'my_content_type',
    // #__content
    array(
        'title'=> $fields['some_field']->value, // etc
    ),
    // #__cck_store_form_my_content_type
    array(
        'some_db_column'=> $fields['some_other_field']->value, // etc
    )
    // #__cck_store_item_content = ????????????
);

 

Thanks

Bucklash

Get a VIP membership
4229 Posts
Kadministrator
8 years ago
2
Level 1

Just look at this methods signature ;) $data_more2 is what you are looking for, so you need to add add another array with data for

#__cck_store_item_contentype

create( $cck, $data_content, $data_more = null, $data_more2 = null )
4229 Posts
Kadministrator
8 years ago
1
Level 2

Just a note: last parameter was added in one of recent versions, so update seblod first.

1283 Posts
Bucklash
8 years ago
0
Level 3

Thanks Klas

I should have looked harder :)

Get a VIP membership