The social field type provides a dropdown input of social netwroks.
This field type is using Image-Select, a select widget with image support for Single and Multi select HTML tags.
websemantics.field_type.social
The social field type provides a dropdown input of scoial accounts (facebook, youtube etc).
Example Definition:
protected $fields = [
'example' => [
'type' => 'websemantics.field_type.social',
'config' => [
'default_value' => 'facebook',
'top_options' => [
'facebook',
'youtube',
'twitter'
],
'handler' => 'Websemantics\SocialFieldType\SocialFieldTypeOptions@handle'
]
]
];
The default social account selected. Any valid social account id can be used (i.e. 'twitter'). The default value is 'facebook'
.
An array of social accounts to put at the top of the scoial dropdown. Any array of social ids can be used. There are no top options by default.
The options handler callable string. Any valid callable class string can be used. The default value is 'Websemantics\SocialFieldType\SocialFieldTypeOptions@handle'
.
The handler is responsible for setting the available options on the field type instance.
NOTE: This option can not be set through the GUI configuration.
This field type returns the selected social account by default.
Returns the social account name
// Twig Usage
{{ entry.example.name }}
// API usage
$entry->example->name();
$locale
- Any valid i18n language code. If none is provided the config('app.locale')
value will be used.
Returns the translated social account name in a specified locale.
// Twig Usage
{{ entry.example.translated('es') }}
// API usage
$entry->example->translated('es');
This plaugin was modeled after Country Field Type