1

having a bit of a problem with a field type and trying to pass in tag data.:

in my template i have

{entries ...} {field} {keys}{key}{/keys}{/field} {/entries}

however when i do a var_dump($tag_data) in the replace_tag() function i am getting false.

however a var_dump($data) if producing the expected data in the same function..

Any Ideas?

Additional: i have already tried a tag pair in the same format as {myfield:option} Tag data here {/myfield}

1 Answer 1

4

You have to add the has_array_data property to your fieldtype class:

class My_field extends EE_Fieldtype {
  public $has_array_data = TRUE;

  ...
}
3
  • hi thanks for the reply - could you eleborate on how to do that - this is my first time creating a field type and the docs are lacking..
    – 4razmus
    Commented Nov 18, 2013 at 17:19
  • Updated the example. It's really that simple. Commented Nov 18, 2013 at 17:31
  • most excellent - kinda makes a mockery of my wasted time though hehe
    – 4razmus
    Commented Nov 18, 2013 at 18:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.