-
Notifications
You must be signed in to change notification settings - Fork 5
Presentation Semantics
Ajit Jain edited this page May 26, 2015
·
5 revisions
Our meta-metadata wrappers allow for the inclusion of presentation information (styling). The following are all the currently used methods to style data.
- style_name
- Signals that some data should be displayed in a certain style. MICE adds the given name to the field's class list, allowing for easy manipulation of style with CSS.
- label
- A string to use as the label for a metadata field instead of the field's name attribute.
<scalar name="title" label="restaurant">
<xpath>//div/h2</xpath>
</scalar>
- format
- Determines what format the data field will be in. Only accepts the value text
<scalar name="title" format="text">
<xpath>//div/h2</xpath>
</scalar>
- navigates_to
- hyperlinks the metadata field to specified field.
<scalar name="location" hide="true">
<xpath>./@href</xpath>
</scalar>
<scalar name="title" label="patent_class" navigates_to="location">
<xpath>.</xpath>
</scalar>
- is_facet
- tbd
- layer
- A floating point value. When displayed, a field with a larger layer value should be rendered above a field with a lower layer value.
<scalar name="review_content" layer="4.0"/>
- hidden
- A boolean value. Set to true to hide metadata from display. This is identical to hide
<scalar name="location" hidden="true" />
- use_value_as_label
- Allows you to use the value of another field, or collection of fields, including images, as the label for a field.
<scalar name="title" use_value_as_label="main_images">
<xpath>//div[@id='breadcrumbs']/ul/li[last()]</xpath>
</scalar>
- label_at
- Allows positioning the label w.r.t. the value of a metadata field. label_at attribute values are: left (default), right, top, bottom.
<scalar name="num_tweets" label="tweets" label_at="bottom">
<xpath>//table[@class='stats js-mini-profile-stats ']//td[1]/a/strong</xpath>
<xpath>//ul[@class='ProfileNav-list']/li[1]//span[@class='ProfileNav-value']</xpath>
</scalar>
- concatenates_to
- Concatenates the metadata field to the specified field. You can concatenate any number of metadata fields.
<scalar name="num_following" label="following" label_at="bottom" concatenates_to="num_tweets">
<xpath>//table[@class='stats js-mini-profile-stats ']//td[2]/a/strong</xpath>
<xpath>//ul[@class='ProfileNav-list']/li[3]//span[@class='ProfileNav-value']</xpath>
</scalar>
- hide_label
- A boolean value. Allows hiding the label of a metadata field.
<scalar name="title" hide_label="true">
<xpath>//div[@id='breadcrumbs']/ul/li[last()]</xpath>
</scalar>
- hide
- When true, the data for a field is extracted, but the field is not displayed.
<scalar name="arbitrary_field" hide="true">
- always_show
- Indicates that some data should never be hidden.
<composite name="photo" hide_label="true">
<xpath>//a[@class='profile-picture media-thumbnail js-tooltip']/img</xpath>
<xpath>//img[@class='ProfileAvatar-image ']</xpath>
<scalar name="location" always_show="true">
<xpath>./@src</xpath>
</scalar>
</composite>
- show_expanded_initially
- If true, the collection's children will be displayed without needing to expand the collection in mice.
- show_expanded_always
- If true, the collection is shown expanded initially and no buttons will be rendered that enable collapsing it in MICE.