Skip to content

Commit

Permalink
Merge pull request #7 from daun/feat/bard-export
Browse files Browse the repository at this point in the history
Allow exporting Bard fields
  • Loading branch information
doefom authored Dec 20, 2024
2 parents 55c85f0 + 4622c3d commit 4ebfb53
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Exports/EntriesExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ private function toString(mixed $value): string

if (
$fieldType instanceof \Statamic\Fieldtypes\Text // Slug field type inherits from Text and therefore must not be checked separately
|| $fieldType instanceof \Statamic\Fieldtypes\Bard
|| $fieldType instanceof \Statamic\Fieldtypes\Markdown
|| $fieldType instanceof \Statamic\Fieldtypes\Textarea
|| $fieldType instanceof \Statamic\Fieldtypes\Video
Expand All @@ -126,6 +125,10 @@ private function toString(mixed $value): string
return $value->value() ? 'yes' : 'no';
}

if ($fieldType instanceof \Statamic\Fieldtypes\Bard) {
return json_encode($value->value());
}

if (
$fieldType instanceof \Statamic\Fieldtypes\Checkboxes
|| $fieldType instanceof \Statamic\Fieldtypes\Arr
Expand Down

0 comments on commit 4ebfb53

Please sign in to comment.