# Custom Tag Kirby 3

**URL:** <https://forum.getkirby.com/t/custom-tag-kirby-3/14238>\
**Category:** Questions\
**Tags:** v3\
**Created:** [May 15, 2019, 5:01pm UTC](https://forum.getkirby.com/t/custom-tag-kirby-3/14238 "2019-05-15T17:01:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dvallance](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@dvallance](https://forum.getkirby.com/u/dvallance)\
**Post date:** [May 15, 2019, 5:01pm UTC](https://forum.getkirby.com/t/custom-tag-kirby-3/14238/1 "2019-05-15T17:01:33Z")

</div>

Hi

I’m creating a custom tag for a website I’m doing, I can’t manage to load an image from its filename:

```
<?php
Kirby::plugin('portfolio/test', [
  'tags' => [
    'illustration' => [
      'attr' => [
        'id','file','caption'
      ],
      'html' => function($tag) {

        return '<span class="image-link">' . $tag->value . '</span> <span id="' . $tag->id . '"> <span class="project-image">' .$tag->parent()->file("' . $tag->file . '"). '</span><span class="project-caption">' . $tag->caption . '</span></span>';

      }
    ]
  ]
]); 

```

The bit that is not working is obviously that one but I don’t really understand why:

`' .$tag->parent()->file("' . $tag->file . '"). '`

Thanks!

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [May 15, 2019, 5:13pm UTC](https://forum.getkirby.com/t/custom-tag-kirby-3/14238/2 "2019-05-15T17:13:31Z")

</div>

> [@dvallance](#):
>
> $tag-\>parent()-\>file(“’ . $tag-\>file . '”)

Should be

```auto
$tag->parent()->file($tag->file)

```

---

<div class="post-metadata">

**Author:** ![dvallance](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@dvallance](https://forum.getkirby.com/u/dvallance)\
**Post date:** [May 15, 2019, 5:14pm UTC](https://forum.getkirby.com/t/custom-tag-kirby-3/14238/3 "2019-05-15T17:14:07Z")

</div>

I just figured out, thanks texnixe!
