Skip to content

Commit b7c1175

Browse files
authored
URLs instead of IDs
As I'm sure you know, assets IDs were replaced by URLs in v2.5.0. FYI: This works perfectly for my usecase - thanks you for sharing it: - Portfolio site with a global grid field to allow client to add their social media channels - Grid has an asset field to set an SVG file - Need to inline the SVG in order to style with CSS (fill colour changes depending on context)
1 parent 69f9f66 commit b7c1175

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addons/SvgOutput/SvgOutputTags.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class SvgOutputTags extends Tags
99
{
1010
public function index()
1111
{
12-
$asset = Asset::find($this->get('id'));
12+
$asset = Asset::find($this->get('url'));
1313
$class = $this->get('class');
1414
$svg = $asset->disk()->get($asset->path());
1515
$pattern = '/(<svg\s+.*?class=".*?)(".*)/';

0 commit comments

Comments
 (0)