# Image previews with custom script

> When I upload image and insert it as a preview N1ED adds attribute rel="lightbox" to support beautiful opening of a preview in full screen mode. But I do not use LightBox, I use my own script and I need to set attribute data-img="preview".

Source: https://n1ed.com/qa/image-previews-with-custom-script  
Updated: 2026-09-20  
Every page of n1ed.com has a Markdown copy at its URL + `.md` (`index.md` after a URL that ends in `/`); all of them are in one file: https://n1ed.com/llms-full.txt

**Kate B.** asked on 2019-11-15:

When I upload image and insert it as a preview N1ED adds attribute `rel="lightbox"` to support beautiful opening of a preview in full screen mode. But I do not use LightBox, I use my own script and I need to set attribute `data-img="preview"`.

**Dmitriy Komarov** answered on 2019-11-11:

By default Image Preview widget is added with adding `rel="lightbox"` to let it work with LightBox, ShadowBox and other scripts compatible with each other. If you want to use your own script, please modify template of your widget:

```js
widgets.ImagePreview.templateLink = {
    classes: [],
    styles: {
        "background-color": "white",
        "margin": "3px",
        "outline": "none"
    },
    attributes: {
        "rel": "lightbox",
        "data-img": "preview"
    }
```

This configuration extends [default widget parameters](https://n1ed.com/docs/configuration). Of course you can remove `rel` attribute if you do not need it anymore.

*Solved*
