Coder Social home page Coder Social logo

microformats2's Introduction

microformats2
-------------

This module provides a way to markup your entities with microformats2.
It therefore wraps a field's content into a span or div with the corresponding classes.

Installation
------------

1. Normal Drupal module installation
   See https://www.drupal.org/documentation/install/modules-themes

2. Create some fields with Content you want to markup with microformats2

Optional dependencies
---------------------

3. You may use the field_group module to group fields into formats
   See https://www.drupal.org/project/field_group

Supported third parties
-----------------------

4. You may use addressfield module to markup addresses
   See https://www.drupal.org/project/addressfield

5. You may use title module to markup core pseudo fields
   See https://www.drupal.org/project/title

Usage
-----

At the time being there is no ui to control the mapping.
Instead use drush to save the mapping to a variable.

    php -r "print json_encode(array('field_name', 'microformats2_property_name'));"  | drush vset --format=json

Markup a simple microformats2 h-card
------------------------------------

* Download and enable field_group module
  `drush en -y field_group`
* Create a field_group named `group_hcard`
* Create a field named `field_given_name`
* Create a field named `field_family_name`
* Move the two fields into the field group
* Mark up the information with microformats2

    php -r "print json_encode(array('group_hcard' => array('format' => 'h-card'), 'field_given_name' => 'p-given-name', 'field_family_name' => 'p-family-name'));"  | drush vset --format=json

Markup a more complex microformats2 h-card
------------------------------------------

* Download and enable addressfield module
  `drush en -y addressfield`
* Create a addressfield named `field_address`
* Move it into the previously created `group_hcard`
* Mark up the information with microformats2

    drush vset --format=json microformats2_mapping  `php -r "print json_encode(array('group_hcard' => array('format' => 'h-card'), 'field_full_name' => 'p-name', 'field_given_name' => 'p-given-name', 'field_family_name' => 'p-family-name', 'field_address' => array('format' => 'h-adr', 'properties' => array('organisation_block|organisation_name' => 'p-label', 'name_block|name_line' => 'p-label', 'street_block|thoroughfare' => 'p-street-address', 'street_block|premise' => 'p-extended-address', 'locality_block|postal_code' => 'p-postal-code', 'locality_block|locality' => 'p-locality', 'locality_block|dependent_locality' => 'p-locality', 'locality_block|administrative_area' => 'p-locality', 'country' => 'p-country-name'))));"`

microformats2's People

Watchers

Stefan Auditor avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.