Skip to content

Commit

Permalink
Add support for link attributes in advanced tab
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusMagnell committed Oct 15, 2020
1 parent 6dbb09e commit 1f1bb69
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/GraphQL/DocumentElementType/LinkDataType.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,46 @@ public function __construct(Service $graphQlService)
}
}
],
'accesskey' => [
'type' => Type::string(),
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof \Pimcore\Model\Document\Tag\Link) {
return $value->getData() ? $value->getData()["accesskey"] : null;
}
}
],
'relation' => [
'type' => Type::string(),
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof \Pimcore\Model\Document\Tag\Link) {
return $value->getData() ? $value->getData()["rel"] : null;
}
}
],
'tabindex' => [
'type' => Type::string(),
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof \Pimcore\Model\Document\Tag\Link) {
return $value->getData() ? $value->getData()["tabindex"] : null;
}
}
],
'class' => [
'type' => Type::string(),
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof \Pimcore\Model\Document\Tag\Link) {
return $value->getData() ? $value->getData()["class"] : null;
}
}
],
'attributes' => [
'type' => Type::string(),
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof \Pimcore\Model\Document\Tag\Link) {
return $value->getData() ? $value->getData()["attributes"] : null;
}
}
],
]
];
parent::__construct($config);
Expand Down

0 comments on commit 1f1bb69

Please sign in to comment.