Views vCards

Component ID

2270885

Component name

Views vCards

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

1901

Component created

Component changed

Component body

Overview

This module aims to provide a vCard attachment for views in a similar way as the views built in feeds system does.

The existing vCards modules vCard and vCard Field work with either Profile2 data, or data the user has to enter himself. There was however no solution for websites that use the Core profile system. This module attempts to fill that gap. (But should in theory be able to use all content that views has access to.)

Basic concepts

This module is based on the way the views module builds RSS and XML feeds. By selecting several fields from a (user) entity and assigning them to specific vCard fields, a complete vCard can be constructed.
When a selection contains one vCard, it is delivered as it is. When a selection contains multiple vCards, they get zipped before the download starts.

Dependencies (Drupal 7)

Drupal 8

The Drupal 8 port appears to be functioning quite well, but it can use some more polishing. ZipStream 0.3.1 is required and needs to be installed using composer.

Configuration

  1. Create or edit a View showing users (any entity will do, but users make the most sense), then create a new display of type 'vCard'. In this display choose vCards for both 'Format' and 'Show'. The Show settings dialog will allow you to select what user field should be used for each vCard property.
    • Make sure the fields you want to use are added in the fields section,
      otherwise they will not show up.
  2. Views vCards offers the 'attach to' option under vCard settings, allowing this module to add a download link to another display. You can for instance set up your user list view as normal with all (exposed) filters if you require them, attach the vCard display to this and the vCard export will adapt to the set filters and provide the right vCards.

Make sure never to expose the usernames of accounts (except for admins who can already see them).

Soft dependency

  • This module has a soft dependency on Pathauto. If this is not installed, single vcards will be named vcard.vcf. If pathauto is installed, they get the configured full name.

Bugs, errors and other features

If something does not work as expected, or if you miss something. Feel free to open a new issue.