Hi codekadiya
I would use for loop in afterstore.
I would assign all required values in to an array or arrays or however you like to do it.
and then loop through the values creating an article in each loop
Something like this:
$arrLength = count($sitesArray);// for loop
for ($i = 0; $i < $arrLength; $i++) {
$newContent = new JCckContent(
array('joomla_content')
);
$addContent = $newContent->create(
'my_cool_sites_content_type',
array(
// #__content table
'id' => 0, // 0 creates new
'title' => $sitesArray['title'][$i], // or however you stored the values
'alias' => $sitesArray['alias'][$i], // or however you stored the values
'catid' => (int) $sitesArray['catid'], // or maybe $fields['catid']->value etc...
etc...
),
array(
// #__cck_store_form_my_cool_sites_content_type
'some_local_field' => $fields['field_only for current_content_type']->value
),
array(
// #__cck_store_item_content
'some_global_field' => $fields['global_field_of_article_object']->value
)
);
}