This site uses cookies and similar technologies.

If you don't change browser settings, you agree to it.

I understand
1183 Posts
Bucklash
6 months ago
Topic

SOLVED: I had simply missed out a line of code in tmpl/edit/php.....

defined( '_JEXEC' ) or die;
$options2   =   JCckDev::fromJSON( $this->item->options2 ); <- this was missing....


This was driving me nuts!!!!

------------------------------------------------

Hi folks

Hoping someone can suggest where I am going wrong...

  • I have created a custom field (type: cck field)
  • I can create an instance of it
  • It stores data in db.
  • When I edit the field the data is not retrieved...

EXAMPLE

  • In tmpl/edit.php ...
echo JCckDev::renderForm( 'core_dev_text', @$options2['content_type'], $config, array( 'label'=>'CONTENT_TYPE', 'storage_field'=>'json[options2][content_type]' ), array(), 'database content-type' );
  • I create an instance of the field in my content type form.
  • I save the data.
  • It stores in #__cck_core_fields i.e. 
"content_type":"#__cck_store_free_map"....
  • But when I reopen the field, there is no data shown.

Any ideas??

Thanks in advance

Jon

Get a Book for SEBLOD
4228 Posts
Kadministrator
6 months ago
2
Level 1

You need to implement onCCK_FieldPrepareContent and onCCK_FieldRenderContent methods, see core fields for examples.

1183 Posts
Bucklash
6 months ago
1
Level 2

1183 Posts
Bucklash
6 months ago
0
Level 3

Get a Book for SEBLOD