The fields component (Vvveb\Component\Fields) renders custom field values for posts, products, users, orders and taxonomy items. The type option selects the entity; without a valid type the component returns an empty array. Caching is disabled ($cacheExpire = 0).
Activate the component by adding:
data-v-component-fields
Component Options
Add options as HTML attributes using the data-v-* syntax.
| Option | Attribute | Description | Default |
|---|---|---|---|
| start | data-v-start |
Starting offset | 0 |
| limit | data-v-limit |
Number of fields to display | 100 |
| site_id | data-v-site_id |
Site ID | Current site |
| language_id | data-v-language_id |
Language ID | Current language |
| type | data-v-type |
Entity type: post, product, user, order, taxonomy_item (required) |
null |
| subtype | data-v-subtype |
Field subtype filter | null |
| post_type | data-v-post_type |
Post type context | null |
| product_id | data-v-product_id |
Filter by product, from URL by default | url |
| post_id | data-v-post_id |
Filter by post, from URL by default | url |
| user_id | data-v-user_id |
Filter by user, from URL by default | url |
| order_id | data-v-order_id |
Filter by order, from URL by default | url |
| taxonomy_item_id | data-v-taxonomy_item_id |
Filter by category/tag, from URL by default | url |
| field_id | data-v-field_id |
Filter to specific field IDs (array) | null |
| field_group_id | data-v-field_group_id |
Filter by field group | null |
Component Properties
Each field is wrapped in an element marked with data-v-field. The component decodes the settings JSON into name/type and exposes the stored value (JSON-decoded when it holds an object). Nested sub-fields render inside data-v-subfields / data-v-subfields-field.
HTML Example
<div data-v-component-fields data-v-type="product" data-v-product_id="url">
<div data-v-field>
<span data-v-field-name>Field name</span>
<span data-v-field-value>Field value</span>
</div>
</div>
Notes
typemust be one ofpost,product,user,order,taxonomy_item; any other value returns nothing.- Entity ID options (
product_id,post_id, …) default tourl, i.e. they are read from the page GET parameters on detail pages.