Hello,

I just installed this module for my custom entity type and it works very well!

However I see that in the display settings, it is tightly related to nodes:

  • Colors for content types
  • Event content type

But, as said, I'm not using nodes.

Would it be possible to base those functionnalities on the entity type of the view?
I could eventually work on a patch if the maintainer allows such a feature.

Thanks!

CommentFileSizeAuthor
#4 fullcalendar_view-2989513-4.patch8.59 KBMingsong
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dolu created an issue. See original summary.

Ludo.R’s picture

Title: Support other entity types than nodes » Display settings: Support other entity types than nodes
Mingsong’s picture

Hi Dolu,

Yes, it would be great if this module can support custom entities other than Node.

I have already put this feature into the Following up list. I am attempting to make some time to work on it.

You are more than welcome to contribute a patch for this new feature.

Cheers,

Mingsong’s picture

Patch is attached.

If you could help me to test this patch with your custom entity and let me know how it goes, that would be great.

Thanks,

Mingsong’s picture

Status: Active » Needs review
Ludo.R’s picture

Hi Mingsong!

Thanks for this work!

I just tested your patch and catched following issues:

  • I'm not able to select the Event Taxonomy Field
  • I'm using a custom module for my custom entity type. It defines its own permission names and add page. Both of them are partially hard-coded in fullcalendar_view module:
// Open a new window to create a new event (content).
window.open(drupalSettings.path.baseUrl + drupalSettings.entityID + '/add/' + drupalSettings.eventBundleType + '?start=' + date + '&start_field=' + drupalSettings.startField, '_blank');
  // Can the user add a new event?
  $dbl_click_to_create = FALSE;
  if (!empty($user) && $user->hasPermission("create $event_bundle_type " . $view->getBaseEntityType()->getLabel())) {
    $dbl_click_to_create = TRUE;
  }

I guess they could be retrieved directly from the Entity definition class:

/**
 * Defines the Sub content entity.
 *
 * @ingroup sub_content
 *
 * @ContentEntityType(
 *   id = "sub_content",
 *   label = @Translation("Sub content"),
 *   bundle_label = @Translation("Sub content type"),
 *   handlers = {
 *     // ...
 *     "access" = "Drupal\sub_content\SubContentAccessControlHandler",
 *     // ...
 *   },
 *   // ...
 *   links = {
 *     "canonical" = "/admin/content/sub_content/{sub_content}",
 *     "add-page" = "/admin/content/sub_content/add",
 *     "add-form" = "/admin/content/sub_content/add/{sub_content_type}",
 *     "edit-form" = "/admin/content/sub_content/{sub_content}/edit",
 *     "delete-form" = "/admin/content/sub_content/{sub_content}/delete",
 *     "version-history" = "/admin/content/sub_content/{sub_content}/revisions",
 *     "revision" = "/admin/content/sub_content/{sub_content}/revisions/{sub_content_revision}/view",
 *     "revision_revert" = "/admin/content/sub_content/{sub_content}/revisions/{sub_content_revision}/revert",
 *     "revision_delete" = "/admin/content/sub_content/{sub_content}/revisions/{sub_content_revision}/delete",
 *     "translation_revert" = "/admin/content/sub_content/{sub_content}/revisions/{sub_content_revision}/revert/{langcode}",
 *     "collection" = "/admin/content/sub_content",
 *   },
 *   // ...
 * )
 */

So from the access handler and links add-page.

The rest seems to work well:
I can change the color for the different types.

  • Mingsong committed 74d44ca on 8.x-2.x
    Issue #2989513 by Mingsong, dolu: Display settings: Support other entity...
Mingsong’s picture

Hi Dolu,

I just push the new Dev version which delivers the feature that support custom entity type.

If you download the latest Dev version, it would match your requirement.

Cheers,

Ludo.R’s picture

Thanks, the project for which I was testing this module is on hold for now, but I'll make try when I'll be working on it again.

mmomin’s picture

@Mingsong,

Thank You so much for this module. I tried using it with event entity type. everything works fine except I am not able to select the taxonomy field to set the colors based on terms under settings.

Mingsong’s picture

Status: Needs review » Closed (outdated)

I close it as 8.x branch is not supported anymore.

Which means the new feature quested won't be consider anymore.

I recommend another module called Fullcalendar Block to see if it match your needs.