# The image-slug variable isn't producing any output

**URL:** https://discourse.notenik.app/t/the-image-slug-variable-isnt-producing-any-output/591
**Category:** Questions
**Created:** [October 9, 2024, 9:05am UTC](https://discourse.notenik.app/t/the-image-slug-variable-isnt-producing-any-output/591 "2024-10-09T09:05:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Malcolm](https://discourse.notenik.app/letter_avatar_proxy/v4/letter/m/e19b73/32.png) [@Malcolm](https://discourse.notenik.app/u/Malcolm)
#### Post date: [October 9, 2024, 9:05am UTC](https://discourse.notenik.app/t/the-image-slug-variable-isnt-producing-any-output/591/1 "2024-10-09T09:05:03Z")

</div>

I wonder what I’m doing wrong. I’ve started a new collection using the “website” starter. I added an Image Name field.

```auto
Image Name: <imagename>

```

And then attached an image to the posts. Should I expect to see the image displayed in Notenik? I seem to remember that was supposed to happen. The attached image name is displayed but not the image.

Next I modified the Post template to include the image slug.

```auto
<div>=$image-slug$=</div>

```

Then I ran the factory script and the web site was produced. The web page source code contains an empty DIV in the place I expected to see my image.

```auto
<div></div>

```

---

<div class="post-metadata">

### Author: ![hbowie](https://discourse.notenik.app/user_avatar/discourse.notenik.app/hbowie/32/6_2.png) [@hbowie](https://discourse.notenik.app/u/hbowie)
#### Post date: [October 9, 2024, 9:22pm UTC](https://discourse.notenik.app/t/the-image-slug-variable-isnt-producing-any-output/591/2 "2024-10-09T21:22:07Z")

</div>

In your Collection settings, check to see that ‘Enable Local Image References’ is checked; this is not on by default. This should result in you seeing your images within Notenik.

To see the image in your output, you will probably need to add a `copyfile` command to your merge template, just above the reference to the image file.

This command causes a file to be copied from the location specified by the first operand, to the location specified by the second operand.

Note that this command is designed to be used with the Image Name field, so that an image file accompanying a note can be copied to an appropriate output folder, from which it will be referenced by an output web page.

Following is an example.

```auto
<?copyfile "../../content/writings/files/=$imagename$=" "../../web/images/=$imagename&f$=" ?>

```

This will copy the image file for each Note to a corresponding output folder where it can be found by the Image Slug derived variable.

Let me know if these suggestions help!

---

<div class="post-metadata">

### Author: ![Malcolm](https://discourse.notenik.app/letter_avatar_proxy/v4/letter/m/e19b73/32.png) [@Malcolm](https://discourse.notenik.app/u/Malcolm)
#### Post date: [October 10, 2024, 12:33am UTC](https://discourse.notenik.app/t/the-image-slug-variable-isnt-producing-any-output/591/3 "2024-10-10T00:33:19Z")

</div>

Enable Local Image Reference does cause the image to be displayed in the collection. Nice.

The `copyfile` command has done it’s magic. The web site is full of images now.

@hbowie I have read and re-read the information about producing a web site and I struggle to understand it. Normally your writing is clear and explanatory. The instructions to output web content is tantalisingly opaque. The intention isn’t clear and I think it makes assumptions about prior knowledge.

It’s apparent that there are a lot of different pathways but it’s confusing.

![image](https://discourse.notenik.app/uploads/db0641/original/1X/88fe1a62d1db39e78e988444f7633144bdcd489e.jpeg)

---

<div class="post-metadata">

### Author: ![hbowie](https://discourse.notenik.app/user_avatar/discourse.notenik.app/hbowie/32/6_2.png) [@hbowie](https://discourse.notenik.app/u/hbowie)
#### Post date: [October 10, 2024, 3:37pm UTC](https://discourse.notenik.app/t/the-image-slug-variable-isnt-producing-any-output/591/4 "2024-10-10T15:37:56Z")

</div>

Thanks. I appreciate the feedback! If there are more specifics that are missing, or that are tripping you up, let me know!
