1283 Posts
Bucklash
5 years 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
4229 Posts
Kadministrator
5 years ago
2
Level 1

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

1283 Posts
Bucklash
5 years ago
1
Level 2

1283 Posts
Bucklash
5 years ago
0
Level 3

Get a Book for SEBLOD