Skip to main content
1 of 2
Brad Bell
  • 67.6k
  • 6
  • 75
  • 145

Completely untested, but a possibility would be to define your content attribute like so:

return array(AttributeType::Mixed, 'model' => 'MyPluginContentModel');

When Craft pulls the JSON from the database, it should decode it and populate your model with any matching attributes it finds.

That gets returned to your template and you can access it via {{ value.id }}.

Brad Bell
  • 67.6k
  • 6
  • 75
  • 145