Skip to content

A few Drupal FieldTypes use for strings with reference entities attached (like language)

License

Notifications You must be signed in to change notification settings

jhu-idc/reference_value_pair

Repository files navigation

This repo was originally created by: https://git.drupalcode.org/project/reference_value_pair

It is modified slightly to meet our needs here at JHU.

Specific changes include:

  • the addition of a variant of the Reference Value Field Type called Language Value Pair that pairs a string with a Language Taxonomy Term.
  • serialization into JSON-LD via a hook in the module code.

Reference Value Pair FieldType is generic and will accomodate a string attached to any entity reference.

The Language Value Pair is more specific and requires that a Language Taxonomy exists. The Language Taxonomy must have a field in it named field_language_code. The field_language_code needs to be string that this module can use to put into the JSON-LD for this widget.

A good TODO would to bring this Language Taxonomy into this module to ensure that it's there.


CONTENTS OF THIS FILE

  • Introduction
  • Requirements
  • Installation
  • Configuration
  • Maintainers

INTRODUCTION

The Reference value pair module combines an entity reference with a free text value field in one new field type.

Site builders often end up using field collection or entity reference modules when all they want to do is store a value and a reference (e.g. to a taxonomy term).

This module bundles the two things, a reference to some entity and a value together in one field. It can reference any entity, the value field is a simple text field.

One typical use is storing a measurement with its unit where the units are stored in a taxonomy (e.g 50 liter, 20 cm, 80 %).

REQUIREMENTS

This module requires no modules outside of Drupal core.

INSTALLATION

CONFIGURATION

No configuration is necessary. Once enabled, a "Reference value pair" field is available.

MAINTAINERS

Updates to this specific repo by:

Original maintainers for https://git.drupalcode.org/project/reference_value_pair

Original Supporting organization for https://git.drupalcode.org/project/reference_value_pair

About

A few Drupal FieldTypes use for strings with reference entities attached (like language)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published