2

I guess everyone here has done what I want multiple times and I am probably just stupid but I can't seem to find it.

So in my drupal 7 installation I want to create an entity with a date property(so all bundles have a date that is set by a user). Perfect scenario is that this date is like the date field with calender to select a date.

I can't find how to do this but that's probably because I have no idea what to look for.

Can someone put me in the right direction for this?

Making it more clear: I could just add a date field in all bundles but that seems not the best way to me and I would like to learn drupal in it's best practice.

thanks in advance

1 Answer 1

3

You can follow the documentation of eck modules. https://www.drupal.org/node/1370980 The last version introduces the concept of behaviour and you can create your own.

  1. Install the module date_popup
  2. Implement the hook hook_ctools_plugin_directory()
  3. Create your plugin
  4. In the default_widget callback return a renderable array where the #type is date_popup
2
  • Cool, thanks! But how to create new type (not a property behaviour)? Commented Aug 16, 2017 at 13:55
  • 1
    looks like i found function function HOOK_eck_property_types() + function HOOK_eck_property_types_alter(&$types) + function HOOK_eck_property_type_schema_alter(&$type, &$schema) Commented Aug 16, 2017 at 14:17

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.