1

I created my custom entity named: image_gallery_basic and I am trying to use it in my new project. As it was my first ever created entity, it has a lot of things missing I guess. I created a content type named review, where user is able to write his review and image gallery is created with the same name as review title. Everything works and it is being created, although when I tried to change it display to link, it doesn't work. I am pretty sure something is missing from my hook_entity_info, but I am not sure what, can some one please put me on the right track? I add my hook_entity_info function.

function image_gallery_entity_info() {
  $image_gallery_info['image_gallery_basic'] = array(
      'label' => t('gallery'),
      'label callback' => 'image_gallery_label_callback',
      'base table' => 'image_gallery_gallery',
      'uri callback' => 'image_gallery_uri',
      'fieldable' => TRUE,
      'entity class' => 'Entity',
      'controller class' => 'ImageGalleryController',
      'access callback' => 'user_is_logged_in',
      'view modes' => array(
        'image_gallery' => array(
          'label' => t('image_gallery'),
          'custom settings' => FALSE,
        ),
      ),
      'entity keys' => array(
        'id' => 'id',
        'uid' => 'uid',
        'title' => 'title',
        'created' => 'created',
        'changed' => 'changed',
        'gall_description' => 'gall_description',
      ),
      'static cache' => TRUE,
      'bundles' => array(
        'postit' => array(
          'label' => 'ImageGallery',
        'admin' => array(
          'path' => 'admin/structure/image_gallery/manage',
          'access arguments' => array('administer image gallery'),
        ),
      ),
    ),
      'view modes' => array(
      'full' => array(
        'label' => t('Full ImageGallery'),
        'custom settings' =>  FALSE,
        ),
    )
  );
  return $image_gallery_info;
}

This is how it is in the Manage display settings:

enter image description here

And this is how my created review looks like. Under Gallery it should show link not a plain text. enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.