Skip to content

Latest commit

 

History

History
1735 lines (1414 loc) · 43.4 KB

field-type-reference.md

File metadata and controls

1735 lines (1414 loc) · 43.4 KB

Field Types

Use this reference for setting up your content type(s) and fields in your theme's config.php file. Additionally it shows how to access field content in view templates by accessing the $content theme variable.

Textfield

Renders as a HTML text input field. If the #contentformat is html/text, selected text can be formatted. Possible textfield settings for config.php:

SettingValue(s)Value TypeMandatory
#type'textfield'Stringyes
#label'Write some text'Stringyes
#description'Write some text'. Rendered as placeholder.Stringyes
#requiredtrue or falseBooleanyes
#maxlengthBetween 1 and 524288Integeryes
#contentformat'html/text' or 'text'Stringyes
#help'Write some text'. Rendered as help text.Stringyes

Example config.php:

    return [

      '#theme-name' => 'Example Theme',
      '#theme-key' => 'example-theme',
      '#theme-version' => '1.0',
      '#ideaspace-version' => '>=1.2.0',
      '#theme-description' => 'Example.',
      '#theme-author-name' => 'IdeaSpaceVR',
      '#theme-author-email' => '[email protected]',
      '#theme-homepage' => 'https://www.ideaspacevr.org/themes',
      '#theme-keywords' => 'example, simple',
      '#theme-view' => 'scene',

      '#content-types' => [

        'my-content-type' => [
          '#label' => 'My Content Type',
          '#description' => 'Some description text.',
          '#max-values' => 'infinite',
          '#fields' => [

            'my-textfield' => [
              '#label' => 'My Textfield',
              '#description' => 'Enter some text.',
              '#help' => 'Enter some text.',
              '#type' => 'textfield',
              '#maxlength' => 200,
              '#contentformat' => 'text',
              '#required' => true,
            ],

          ], /* fields */

        ], /* messages */

      ], /* content types */

    ];

Textfield array keys for accessing content in a View Template (for example: scene.blade.php):

Array KeyDescription
#idField ID Number
#content-idContent ID Number
#type'textfield'
#valueText

Example:

$content['content-type-key'][0]['textfield-key']['#value']

Textarea

Renders as a HTML text area. If the #contentformat is html/text, selected text can be formatted. Possible textarea settings for config.php:

SettingValue(s)Value TypeMandatory
#type'textarea'Stringyes
#label'Write some text'Stringyes
#description'Write some text'. Rendered as placeholder.Stringyes
#requiredtrue or falseBooleanyes
#rowsBetween 1 and 20Integeryes
#maxlengthBetween 1 and 524288Integeryes
#contentformat'html/text' or 'text'Stringyes
#help'Write some text'. Rendered as help text.Stringyes

Example config.php:

    return [

      '#theme-name' => 'Example Theme',
      '#theme-key' => 'example-theme',
      '#theme-version' => '1.0',
      '#ideaspace-version' => '>=1.2.0',
      '#theme-description' => 'Example.',
      '#theme-author-name' => 'IdeaSpaceVR',
      '#theme-author-email' => '[email protected]',
      '#theme-homepage' => 'https://www.ideaspacevr.org/themes',
      '#theme-keywords' => 'example, simple',
      '#theme-view' => 'scene',

      '#content-types' => [

        'my-content-type' => [
          '#label' => 'My Content Type',
          '#description' => 'Some description text.',
          '#max-values' => 'infinite',
          '#fields' => [

            'my-textarea' => [
              '#label' => 'My Textarea',
              '#description' => 'Enter some text.',
              '#help' => 'Enter some text.',
              '#type' => 'textarea',
              '#maxlength' => 20000,
              '#rows' => 10,
              '#contentformat' => 'html/text',
              '#required' => true,
            ],

          ], /* fields */

        ], /* messages */

      ], /* content types */

    ];

Textarea array keys for accessing content in a View Template (for example: scene.blade.php):

Array KeyDescription
#idField ID Number
#content-idContent ID Number
#type'textarea'
#valueText

Example:

$content['content-type-key'][0]['textarea-key']['#value']

Image

Renders as an image upload button. It opens the Assets dialog window in order to upload an image file or insert an existing image file into the space. Possible image settings for config.php:

SettingValue(s)Value TypeMandatory
#type'image'Stringyes
#label'Write some text'Stringyes
#description'Write some text'. Rendered as placeholder.Stringyes
#requiredtrue or falseBooleanyes
#file-extension['jpg', 'png']Arrayyes
#help'Write some text'. Rendered as help text.Stringyes
#content-preview-imagetrue or false. Rendered as thumbnail image in content overview lists.Booleanno

Example config.php:

    return [

      '#theme-name' => 'Example Theme',
      '#theme-key' => 'example-theme',
      '#theme-version' => '1.0',
      '#ideaspace-version' => '>=1.2.0',
      '#theme-description' => 'Example.',
      '#theme-author-name' => 'IdeaSpaceVR',
      '#theme-author-email' => '[email protected]',
      '#theme-homepage' => 'https://www.ideaspacevr.org/themes',
      '#theme-keywords' => 'example, simple',
      '#theme-view' => 'scene',

      '#content-types' => [

        'my-content-type' => [
          '#label' => 'My Content Type',
          '#description' => 'Some description text.',
          '#max-values' => 'infinite',
          '#fields' => [

            'my-image' => [
              '#label' => 'My Image',
              '#description' => 'Choose an image.',
              '#help' => 'Choose an image.',
              '#type' => 'image',
              '#file-extension' => ['jpg', 'png'],
              '#content-preview-image' => true,
              '#required' => true,
            ],

          ], /* fields */

        ], /* messages */

      ], /* content types */

    ];

Image array keys for accessing content in a View Template (for example: scene.blade.php):

Array KeyDescription
#idField ID Number
#content-idContent ID Number
#type'image'
#captionCaption Text
#descriptionDescription Text
#widthWidth Number
#heightHeight Number
#uri #valueImage URI including protocol and domain name

Example:

$content['content-type-key'][0]['image-key']['#uri']['#value']

Photosphere

Renders as an photo sphere upload button. It opens the Assets dialog window in order to upload an image (photo sphere) file or insert an existing image (photo sphere) file into the space. Possible photosphere settings for config.php:

SettingValue(s)Value TypeMandatory
#type'photosphere'Stringyes
#label'Write some text'Stringyes
#description'Write some text'. Rendered as placeholder.Stringyes
#requiredtrue or falseBooleanyes
#file-extension['jpg', 'png']Arrayyes
#help'Write some text'. Rendered as help text.Stringyes
#content-preview-imagetrue or false. Rendered as thumbnail image in content overview lists.Booleanno

Example config.php:

    return [

      '#theme-name' => 'Example Theme',
      '#theme-key' => 'example-theme',
      '#theme-version' => '1.0',
      '#ideaspace-version' => '>=1.2.0',
      '#theme-description' => 'Example.',
      '#theme-author-name' => 'IdeaSpaceVR',
      '#theme-author-email' => '[email protected]',
      '#theme-homepage' => 'https://www.ideaspacevr.org/themes',
      '#theme-keywords' => 'example, simple',
      '#theme-view' => 'scene',

      '#content-types' => [

        'my-content-type' => [
          '#label' => 'My Content Type',
          '#description' => 'Some description text.',
          '#max-values' => 'infinite',
          '#fields' => [

            'my-photosphere' => [
              '#label' => 'My Photosphere',
              '#description' => 'Choose an 360 image.',
              '#help' => 'Choose a 360 image.',
              '#type' => 'photosphere',
              '#file-extension' => ['jpg', 'png'],
              '#content-preview-image' => true,
              '#required' => true,
            ],

          ], /* fields */

        ], /* messages */

      ], /* content types */

    ];

Photosphere array keys for accessing content in a View Template (for example: scene.blade.php):

Array KeyDescription
#idField ID Number
#content-idContent ID Number
#type'photosphere'
#captionCaption Text
#descriptionDescription Text
#widthWidth Number
#heightHeight Number
#uri #valuePhotosphere URI including protocol and domain name

Example:

$content['content-type-key'][0]['photosphere-key']['#uri']['#value']

Audio

Renders as an audio file upload button. It opens the Assets dialog window in order to upload an audio file or insert an existing audio file into the space. Possible audio settings for config.php:

SettingValue(s)Value TypeMandatory
#type'audio'Stringyes
#label'Write some text'Stringyes
#description'Write some text'. Rendered as placeholder.Stringyes
#requiredtrue or falseBooleanyes
#file-extension['mp3', 'wav']Arrayyes
#help'Write some text'. Rendered as help text.Stringyes

Example config.php:

    return [

      '#theme-name' => 'Example Theme',
      '#theme-key' => 'example-theme',
      '#theme-version' => '1.0',
      '#ideaspace-version' => '>=1.2.0',
      '#theme-description' => 'Example.',
      '#theme-author-name' => 'IdeaSpaceVR',
      '#theme-author-email' => '[email protected]',
      '#theme-homepage' => 'https://www.ideaspacevr.org/themes',
      '#theme-keywords' => 'example, simple',
      '#theme-view' => 'scene',

      '#content-types' => [

        'my-content-type' => [
          '#label' => 'My Content Type',
          '#description' => 'Some description text.',
          '#max-values' => 'infinite',
          '#fields' => [

            'my-audio' => [
              '#label' => 'My Audio',
              '#description' => 'Choose an audio file.',
              '#help' => 'Choose an audio file.',
              '#type' => 'audio',
              '#file-extension' => ['mp3', 'wav'],
              '#required' => true,
            ],

          ], /* fields */

        ], /* messages */

      ], /* content types */

    ];

Audio array keys for accessing content in a View Template (for example: scene.blade.php):

Array KeyDescription
#idField ID Number
#content-idContent ID Number
#type'audio'
#captionCaption Text
#descriptionDescription Text
#durationDuration in seconds
#uri #valueAudio URI including protocol and domain name

Example:

$content['content-type-key'][0]['audio-key']['#uri']['#value']

Video

Renders as a video file upload button. It opens the Assets dialog window in order to upload an video file or insert an existing video file into the space. Possible video settings for config.php:

SettingValue(s)Value TypeMandatory
#type'video'Stringyes
#label'Write some text'Stringyes
#description'Write some text'. Rendered as placeholder.Stringyes
#requiredtrue or falseBooleanyes
#file-extension['mp4']Arrayyes
#help'Write some text'. Rendered as help text.Stringyes

Example config.php:

    return [

      '#theme-name' => 'Example Theme',
      '#theme-key' => 'example-theme',
      '#theme-version' => '1.0',
      '#ideaspace-version' => '>=1.2.0',
      '#theme-description' => 'Example.',
      '#theme-author-name' => 'IdeaSpaceVR',
      '#theme-author-email' => '[email protected]',
      '#theme-homepage' => 'https://www.ideaspacevr.org/themes',
      '#theme-keywords' => 'example, simple',
      '#theme-view' => 'scene',

      '#content-types' => [

        'my-content-type' => [
          '#label' => 'My Content Type',
          '#description' => 'Some description text.',
          '#max-values' => 'infinite',
          '#fields' => [

            'my-video' => [
              '#label' => 'My Video',
              '#description' => 'Choose a video file.',
              '#help' => 'Choose a video file.',
              '#type' => 'video',
              '#file-extension' => ['mp4'],
              '#required' => true,
            ],

          ], /* fields */

        ], /* messages */

      ], /* content types */

    ];

Video array keys for accessing content in a View Template (for example: scene.blade.php):

Array KeyDescription
#idField ID Number
#content-idContent ID Number
#type'video'
#captionCaption Text
#descriptionDescription Text
#widthWidth Number
#heightHeight Number
#durationDuration in seconds
#uri #valueVideo URI including protocol and domain name

Example:

$content['content-type-key'][0]['video-key']['#uri']['#value']

Videosphere

Renders as a video sphere file upload button. It opens the Assets dialog window in order to upload an video sphere file or insert an existing video sphere file into the space. Possible videosphere settings for config.php:

SettingValue(s)Value TypeMandatory
#type'videosphere'Stringyes
#label'Write some text'Stringyes
#description'Write some text'. Rendered as placeholder.Stringyes
#requiredtrue or falseBooleanyes
#file-extension['mp4']Arrayyes
#help'Write some text'. Rendered as help text.Stringyes

Example config.php:

    return [

      '#theme-name' => 'Example Theme',
      '#theme-key' => 'example-theme',
      '#theme-version' => '1.0',
      '#ideaspace-version' => '>=1.2.0',
      '#theme-description' => 'Example.',
      '#theme-author-name' => 'IdeaSpaceVR',
      '#theme-author-email' => '[email protected]',
      '#theme-homepage' => 'https://www.ideaspacevr.org/themes',
      '#theme-keywords' => 'example, simple',
      '#theme-view' => 'scene',

      '#content-types' => [

        'my-content-type' => [
          '#label' => 'My Content Type',
          '#description' => 'Some description text.',
          '#max-values' => 'infinite',
          '#fields' => [

            'my-videosphere' => [
              '#label' => 'My Videosphere',
              '#description' => 'Choose a 360 video file.',
              '#help' => 'Choose a 360 video file.',
              '#type' => 'videosphere',
              '#file-extension' => ['mp4'],
              '#required' => true,
            ],

          ], /* fields */

        ], /* messages */

      ], /* content types */

    ];

Videosphere array keys for accessing content in a View Template (for example: scene.blade.php):

Array KeyDescription
#idField ID Number
#content-idContent ID Number
#type'videosphere'
#captionCaption Text
#descriptionDescription Text
#widthWidth Number
#heightHeight Number
#durationDuration in seconds
#uri #valueVideosphere URI including protocol and domain name

Example:

$content['content-type-key'][0]['videosphere-key']['#uri']['#value']

Color

Renders as an HTML color selector input field. Possible color settings for config.php:

SettingValue(s)Value TypeMandatory
#type'color'Stringyes
#label'Write some text'Stringyes
#description'Write some text'. Rendered as placeholder.Stringyes
#requiredtrue or falseBooleanyes
#help'Write some text'. Rendered as help text.Stringyes
#default_value'#FF0000'. Color value.Stringno

Example config.php:

    return [

      '#theme-name' => 'Example Theme',
      '#theme-key' => 'example-theme',
      '#theme-version' => '1.0',
      '#ideaspace-version' => '>=1.2.0',
      '#theme-description' => 'Example.',
      '#theme-author-name' => 'IdeaSpaceVR',
      '#theme-author-email' => '[email protected]',
      '#theme-homepage' => 'https://www.ideaspacevr.org/themes',
      '#theme-keywords' => 'example, simple',
      '#theme-view' => 'scene',

      '#content-types' => [

        'my-content-type' => [
          '#label' => 'My Content Type',
          '#description' => 'Some description text.',
          '#max-values' => 'infinite',
          '#fields' => [

            'my-color' => [
              '#label' => 'My Color',
              '#description' => 'Choose a color.',
              '#help' => 'Choose a color.',
              '#type' => 'color',
              '#default_value' => '#FFFFFF',
              '#required' => true,
            ],

          ], /* fields */

        ], /* messages */

      ], /* content types */

    ];

Color array keys for accessing content in a View Template (for example: scene.blade.php):

Array KeyDescription
#idField ID Number
#content-idContent ID Number
#type'color'
#valueColor value (hexadecimal)

Example:

$content['content-type-key'][0]['color-key']['#value']

Date

Renders as an HTML date selector input field. Possible date settings for config.php:

SettingValue(s)Value TypeMandatory
#type'date'Stringyes
#label'Write some text'Stringyes
#description'Write some text'. Rendered as placeholder.Stringyes
#requiredtrue or falseBooleanyes
#help'Write some text'. Rendered as help text.Stringyes

Example config.php:

    return [

      '#theme-name' => 'Example Theme',
      '#theme-key' => 'example-theme',
      '#theme-version' => '1.0',
      '#ideaspace-version' => '>=1.2.0',
      '#theme-description' => 'Example.',
      '#theme-author-name' => 'IdeaSpaceVR',
      '#theme-author-email' => '[email protected]',
      '#theme-homepage' => 'https://www.ideaspacevr.org/themes',
      '#theme-keywords' => 'example, simple',
      '#theme-view' => 'scene',

      '#content-types' => [

        'my-content-type' => [
          '#label' => 'My Content Type',
          '#description' => 'Some description text.',
          '#max-values' => 'infinite',
          '#fields' => [

            'my-date' => [
              '#label' => 'My Date',
              '#description' => 'Choose a date.',
              '#help' => 'Choose a date.',
              '#type' => 'date',
              '#required' => true,
            ],

          ], /* fields */

        ], /* messages */

      ], /* content types */

    ];

Date array keys for accessing content in a View Template (for example: scene.blade.php):

Array KeyDescription
#idField ID Number
#content-idContent ID Number
#type'date'
#valueDate value

Example:

$content['content-type-key'][0]['date-key']['#value']

Options Select

Renders as an HTML select input field. Possible options select settings for config.php:

SettingValue(s)Value TypeMandatory
#type'options-select'Stringyes
#label'Write some text'Stringyes
#description'Write some text'. Rendered as placeholder.Stringyes
#requiredtrue or falseBooleanyes
#options['red' => 'Red', 'green' => 'Green', 'blue' => 'Blue']Arrayyes
#help'Write some text'. Rendered as help text.Stringyes
#default_value'green'. Key value from #options.Stringno

Example config.php:

    return [

      '#theme-name' => 'Example Theme',
      '#theme-key' => 'example-theme',
      '#theme-version' => '1.0',
      '#ideaspace-version' => '>=1.2.0',
      '#theme-description' => 'Example.',
      '#theme-author-name' => 'IdeaSpaceVR',
      '#theme-author-email' => '[email protected]',
      '#theme-homepage' => 'https://www.ideaspacevr.org/themes',
      '#theme-keywords' => 'example, simple',
      '#theme-view' => 'scene',

      '#content-types' => [

        'my-content-type' => [
          '#label' => 'My Content Type',
          '#description' => 'Some description text.',
          '#max-values' => 'infinite',
          '#fields' => [

            'my-options' => [
              '#label' => 'My Options',
              '#description' => 'Choose an option.',
              '#help' => 'Choose a option.',
              '#type' => 'options-select',
              '#options' => ['red' => 'Red Bike', 'green' => 'Green Bike', 'blue' => 'Blue Bike'],
              '#required' => true,
            ],

          ], /* fields */

        ], /* messages */

      ], /* content types */

    ];

Options Select array keys for accessing content in a View Template (for example: scene.blade.php):

Array KeyDescription
#idField ID Number
#content-idContent ID Number
#type'options-select'
#valueSelected option

Example:

$content['content-type-key'][0]['options-select-key']['#value']

3D Model

Renders as a 3D model upload button. It opens the Assets dialog window in order to upload a 3D model file (or multiple files: the obj model format consists of obj, mtl and image texture files) or insert an existing 3D model into the space. Possible 3D model settings for config.php:

SettingValue(s)Value TypeMandatory
#type'model3d'Stringyes
#label'Write some text'Stringyes
#description'Write some text'. Rendered as placeholder.Stringyes
#requiredtrue or falseBooleanyes
#file-extension['glb', 'gltf', 'obj', 'ply', 'dae']Arrayyes
#help'Write some text'. Rendered as help text.Stringyes

Example config.php:

    return [

      '#theme-name' => 'Example Theme',
      '#theme-key' => 'example-theme',
      '#theme-version' => '1.0',
      '#ideaspace-version' => '>=1.2.0',
      '#theme-description' => 'Example.',
      '#theme-author-name' => 'IdeaSpaceVR',
      '#theme-author-email' => '[email protected]',
      '#theme-homepage' => 'https://www.ideaspacevr.org/themes',
      '#theme-keywords' => 'example, simple',
      '#theme-view' => 'scene',

      '#content-types' => [

        'my-content-type' => [
          '#label' => 'My Content Type',
          '#description' => 'Some description text.',
          '#max-values' => 'infinite',
          '#fields' => [

            'my-model' => [
              '#label' => 'My Model',
              '#description' => 'Upload a model.',
              '#help' => 'Upload a model.',
              '#type' => 'model3d',
							'#file-extension' => ['obj', 'ply', 'dae', 'glb', 'gltf'],
              '#required' => true,
            ],

          ], /* fields */

        ], /* messages */

      ], /* content types */

    ];

3D Model array keys for accessing content in a View Template (for example: scene.blade.php):

Array KeyDescription
#idField ID Number
#content-idContent ID Number
#type'model3d'
#captionCaption Text
#descriptionDescription Text
#scaleKey value pairs. For example: ['#x' => 1, '#y' => 1, '#z' => 1]
#rotationKey value pairs. In degrees. For example: ['#x' => 90.0, '#y' => 45.0, '#z' => 0.0]
#modelArray containing #uri #value and #uri #filetype keys and values. An *.obj file contains an additional entry for the *.mtl file.

Example:

$content['content-type-key'][0]['model-key']['#model'][0]['#uri']['#value']

$content['content-type-key'][0]['model-key']['#model'][0]['#uri']['#filetype']

Example for obj and mtl files:

$content['content-type-key'][0]['model-key']['#model'][0]['#uri']['#value']

$content['content-type-key'][0]['model-key']['#model'][1]['#uri']['#value']

$content['content-type-key'][0]['model-key']['#model'][0]['#uri']['#filetype']

$content['content-type-key'][0]['model-key']['#model'][1]['#uri']['#filetype']

Position

Renders as a button. It opens a dialog window in order to position, attach and detach content items (of a certain content type). The content positions and content item references can be inserted into a space. Possible position settings for config.php:

SettingValue(s)Value TypeMandatory
#type'position'Stringyes
#label'Write some text'Stringyes
#requiredtrue or falseBooleanyes
#maxnumberBetween 1 and infiniteIntegeryes
#content-type-reference'name-of-content-type'Stringyes
#field-reference'name-of-field'Stringno
#help'Write some text'. Rendered as help text.Stringyes

#content-type-reference specifies WHAT should be positioned and attached in space. The content type you specify must exist in your theme (in config.php file). Examples for content types are: text-notes, blog-posts, images, videos, etc.

#field-reference specifies WHERE content items should be positioned and attached. The field name must exist in your theme (in config.php file) and within the same content type as the position field is in use. Examples for field references are: photo-sphere, video-sphere, 3d-model, etc. #field-reference is optional. If it is not specified, a grid is shown instead.

Example config.php:

    return [

      '#theme-name' => 'Example Theme',
      '#theme-key' => 'example-theme',
      '#theme-version' => '1.0',
      '#ideaspace-version' => '>=1.2.0',
      '#theme-description' => 'Example.',
      '#theme-author-name' => 'IdeaSpaceVR',
      '#theme-author-email' => '[email protected]',
      '#theme-homepage' => 'https://www.ideaspacevr.org/themes',
      '#theme-keywords' => 'example, simple',
      '#theme-view' => 'scene',

      '#content-types' => [

        'my-content-type' => [
          '#label' => 'My Content Type',
          '#description' => 'Some description text.',
          '#max-values' => 'infinite',
          '#fields' => [

            'my-position' => [
              '#label' => 'My Position',
              '#description' => 'Position the model.',
              '#help' => 'Position the model.',
              '#type' => 'position',
              '#maxnumber' => 'infinite',
              '#required' => true,
              '#content-type-reference' => 'model3d',
              '#field-reference' => 'my-model',
            ],

          ], /* fields */

        ], /* messages */

      ], /* content types */

    ];

Position array keys for accessing content in a View Template (for example: scene.blade.php):

Array KeyDescription
#idField ID Number
#content-idContent ID Number
#type'position'
#captionCaption Text
#descriptionDescription Text
#positionsArray entries for positioned content items with key value pairs for #position (#x, #y, #z), #scale (#x, #y, #z), #rotation (#x, #y, #z), #content-id and referenced #content with its corresponding values.

Example:

$content['content-type-key'][0]['position-key']['#positions'][0]['#position']['#x']

$content['content-type-key'][0]['position-key']['#positions'][0]['#position']['#y']

$content['content-type-key'][0]['position-key']['#positions'][0]['#position']['#z']

$content['content-type-key'][0]['position-key']['#positions'][0]['#content-id']

$content['content-type-key'][0]['position-key']['#positions'][..]['#position']['#x']

Example: a reference to an image has been positioned:

$content['content-type-key'][0]['position-key']['#positions'][0]['#content']['image-key']['#width']

$content['content-type-key'][0]['position-key']['#positions'][0]['#content']['image-key']['#height']

$content['content-type-key'][0]['position-key']['#positions'][0]['#content']['image-key']['#caption']

$content['content-type-key'][0]['position-key']['#positions'][0]['#content']['image-key']['#description']

$content['content-type-key'][0]['position-key']['#positions'][0]['#content']['image-key']['#uri']['#value']

Rotation

Renders as a button. It opens a dialog window in order to rotate content items (of a certain content type). The content rotation can be inserted into a space. Possible rotation settings for config.php:

SettingValue(s)Value TypeMandatory
#type'rotation'Stringyes
#label'Write some text'Stringyes
#requiredtrue or falseBooleanyes
#field-reference'name-of-field'Stringyes
#help'Write some text'. Rendered as help text.Stringyes

#field-reference specifies the field name on which to enable the setting of a rotation. The field name must exist in your theme (in config.php file) and within the same content type as the rotation field is in use. Supported field types are: video, videosphere, photosphere, image, model3d.

Example config.php:

    return [

      '#theme-name' => 'Example Theme',
      '#theme-key' => 'example-theme',
      '#theme-version' => '1.0',
      '#ideaspace-version' => '>=1.2.0',
      '#theme-description' => 'Example.',
      '#theme-author-name' => 'IdeaSpaceVR',
      '#theme-author-email' => '[email protected]',
      '#theme-homepage' => 'https://www.ideaspacevr.org/themes',
      '#theme-keywords' => 'example, simple',
      '#theme-view' => 'scene',

      '#content-types' => [

        'my-content-type' => [
          '#label' => 'My Content Type',
          '#description' => 'Some description text.',
          '#max-values' => 'infinite',
          '#fields' => [

            'my-rotation' => [
              '#label' => 'My Rotation',
              '#description' => 'Rotate the model.',
              '#help' => 'Rotate the model.',
              '#type' => 'rotation',
              '#maxnumber' => 'infinite',
              '#required' => true,
              '#field-reference' => 'my-model',
            ],

          ], /* fields */

        ], /* messages */

      ], /* content types */

    ];

Rotation array keys for accessing content in a View Template (for example: scene.blade.php):

Array KeyDescription
#idField ID Number
#content-idContent ID Number
#type'rotation'
#rotationArray entries with key value pairs for rotation (#x, #y, #z).

Example:

$content['content-type-key'][0]['rotation-key']['#rotation']['#x']

$content['content-type-key'][0]['rotation-key']['#rotation']['#y']

$content['content-type-key'][0]['rotation-key']['#rotation']['#z']

Space Reference

Renders as an HTML select input field. Possible space reference settings for config.php:

SettingValue(s)Value TypeMandatory
#type'space-reference'Stringyes
#label'Write some text'Stringyes
#requiredtrue or falseBooleanyes
#publishedtrue or false. List only published spaces or all spaces.Stringyes
#help'Write some text'. Rendered as help text.Stringyes

Example config.php:

    return [

      '#theme-name' => 'Example Theme',
      '#theme-key' => 'example-theme',
      '#theme-version' => '1.0',
      '#ideaspace-version' => '>=1.2.0',
      '#theme-description' => 'Example.',
      '#theme-author-name' => 'IdeaSpaceVR',
      '#theme-author-email' => '[email protected]',
      '#theme-homepage' => 'https://www.ideaspacevr.org/themes',
      '#theme-keywords' => 'example, simple',
      '#theme-view' => 'scene',

      '#content-types' => [

        'my-content-type' => [
          '#label' => 'My Content Type',
          '#description' => 'Some description text.',
          '#max-values' => 'infinite',
          '#fields' => [

            'my-space-ref' => [
              '#label' => 'My Space Reference',
              '#description' => 'Select a space.',
              '#help' => 'Select a space.',
              '#type' => 'space-reference',
              '#required' => true,
              '#published' => true,
            ],

          ], /* fields */

        ], /* messages */

      ], /* content types */

    ];

Space Reference array keys for accessing content in a View Template (for example: scene.blade.php):

Array KeyDescription
#idField ID Number
#content-idContent ID Number
#type'space-reference'
#space-titleThe space title
#space-uriThe space URI
#space-idThe space id

Example:

$content['content-type-key'][0]['space-reference-key']['#space-title']

Painter

Renders as a button which opens a dialog window containing a VR scene from this theme. When entering in VR mode, you have access to a tool to paint in this scene. Possible painter reference settings for config.php:

SettingValue(s)Value TypeMandatory
#type'painter'Stringyes
#label'Write some text'Stringyes
#description'Write some text'Stringyes
#requiredtrue or falseBooleanyes
#help'Write some text'. Rendered as help text.Stringyes
#scene-templateName of a view template which should embed the painter tool. Eg. 'scene-painter' - a scene without camera and laser-controls.Stringyes

Example config.php:

    return [

      '#theme-name' => 'Example Theme',
      '#theme-key' => 'example-theme',
      '#theme-version' => '1.0',
      '#ideaspace-version' => '>=1.2.0',
      '#theme-description' => 'Example.',
      '#theme-author-name' => 'IdeaSpaceVR',
      '#theme-author-email' => '[email protected]',
      '#theme-homepage' => 'https://www.ideaspacevr.org/themes',
      '#theme-keywords' => 'example, simple',
      '#theme-view' => 'scene',

      '#content-types' => [

        'my-content-type' => [
          '#label' => 'My Content Type',
          '#description' => 'Some description text.',
          '#max-values' => 'infinite',
          '#fields' => [

            'post-painter' => [
              '#label' => 'Paint on post',
              '#description' => 'Create a painting in your blog post',
              '#help' => 'VR controllers with 6-DOF (degrees of freedom) are needed',
              '#type' => 'painter',
              '#scene-template' => 'scene-painter', /* scene without camera and laser-controls */
              '#required' => false,
            ],

          ], /* fields */

        ], /* messages */

      ], /* content types */

    ];

When creating the scene-template for painter, you have to include two statements in the template:

  • inside the <a-assets> tags you have to include @php painter_assets(); @endphp

  • after <a-assets> tags include this statement: @php painter_entities(); @endphp

These statements are necessary to make painter work in your template.