5 Posts
Tyandrer
8 years ago
Topic

Hello sebloders ! 

Sorry for my bad english...

I am developing a financial system with accounts payable, receivable, cash , etc. My question is how to create items in the override template . For example , when I put on the form that the account will be split into 3 times , I would create 3 articles, each with a creation date and their respective portions of values. The programming have no problems , just I need to figure out how to create articles in the code , as if making a "send form" . 

Thank you very much in advance!

Get a VIP membership
1283 Posts
Bucklash
8 years ago
5
Level 1

Hi

To get you going there is a Sevlod method to create new content sinilar to Joomla!'s way:

$newFunky = new JCckContent( 
             array('joomla_article') 
         );
         $addNewFunky = $newFunky->create(
             'shiny_new_article',
             array(
// Joomla fields ie title, alias etc
// add values directly
                 'title'=> 'Shiny New',
// or dynamically
                 'alias'=> $config['title'], etc
             array(
                // Seblod fields ie 'my_added_field'
             )
         );
	
5 Posts
Tyandrer
8 years ago
4
Level 2

Thank you for your help Bucklash !
With your answer knew object " CCKCONTENT " and found the resolution in another post in which you also responded.

$content = new JCckContent( array( 'joomla_article' ) );
$status = $content->create(
'some_content_type',
// adds to #__content table
array(
'title'=>JFactory::getDate()->toSql(),
'catid'=>19,
'state'=>1,
'language'=>'*',
'publish_up'=>JFactory::getDate()->toSql(),
'created_by'=> JFactory::getUser()->id
),
// adds to #__cck_store_form_mycontenttype
array(
'field0'=>'something',
'field1'=>'somehing else',
)
);
1283 Posts
Bucklash
8 years ago
3
Level 3

Hi

Cool, glad you have it sorted.

Note: I think it odes not work the same for Categories.

Bucklash

5 Posts
Tyandrer
8 years ago
2
Level 4

Got it... 

Could tell me what parameters to enter articles that have parent?

I tried with this code, however could not make the association. I thought he would do automatically.

1283 Posts
Bucklash
8 years ago
1
Level 5

Hi

Sorry, not sure what you mean

5 Posts
Tyandrer
8 years ago
0
Level 6

The question is how to enter the data into content that has "parent " . 

But I decided otherwise. I turned off the association and created a form where I control via code. I did not use the option of "parent" . 

Thanks a lot for the help!

Get a VIP membership