include-pattern

include pattern

Initially developed as part of resume-brainstorming, it has become clear from actual microformats markup experience with real world sites, that several microformats (e.g. hResume, hReview, hAtom etc.) need a mechanism to include a portion of data from an area of a page into another area of a page. This page documents this pattern for re-use in those microformats and any others that need this feature.

background

In hResume, we needed the ability to include the name from the hCard at the top of the resume for a person into their hCards in the middle of the resume which represented each of their job hCards (job title, organization name, address etc.), and thus developed the hCard reference via object technique.

scope

The include pattern is strictly limited to the scope of the current page. This is by design in order to avoid multipage / multidomain etc. problems. Also "current page" uses cover the vast majority of use cases thus we are solving that problem first.

class name "include"

In order to make this more explicit (helps forward compatibility for parsers), we are adding the class name "include" on the object element to indicate that that object refers to a subtree which should be included in its place by microformat parsers.

Proposal 1: Allow the use of <a href class="include"> as a secondary include-pattern mechanism, due to some browsers mishandling the object include-pattern. See include-pattern-feedback for details.

object include example

Here is an example of an hCard you could have at the top of a page, shown here also as a verbose hCard for purposes of illustration that the reference may be to a subtree, not just a text node:

restrictions

Per the scope, the object 'data' attribute and a 'href' attribute MUST be local ID references when used as include pattern instances. External references (which would require a consuming application to load an external resource) are currently not supported by this method.