# Panel field plugin: Getting the Value of sibling fields in structure field

**URL:** <https://forum.getkirby.com/t/panel-field-plugin-getting-the-value-of-sibling-fields-in-structure-field/33899>\
**Category:** Questions\
**Tags:** v4\
**Created:** [April 4, 2025, 6:39am UTC](https://forum.getkirby.com/t/panel-field-plugin-getting-the-value-of-sibling-fields-in-structure-field/33899 "2025-04-04T06:39:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![memibeltrame](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/memibeltrame/32/4814_2.png) [@memibeltrame](https://forum.getkirby.com/u/memibeltrame)\
**Post date:** [April 4, 2025, 6:39am UTC](https://forum.getkirby.com/t/panel-field-plugin-getting-the-value-of-sibling-fields-in-structure-field/33899/1 "2025-04-04T06:39:39Z")

</div>

Hi everybody,  
I have built a custom panel field plugin that allows me to display an image. The content of the image is written to the content file via an api in form of a bas64 string.  
The image is a screenshot taken during the build process on another platform and is then saved to Kirby into a structure field alongside a product name, version and build number.  
The image can be downloaded via a download button and i would like to put together the download’s name using the product name, version and build number.  
How can I access the value of the sibling fields?  
I tried a few approaches to no avail:

```auto
let productname = this.$parent.data.productname;
OR
this.$store.getters["content/values"]()['myField']

```

These were stabs in the dark since I could not find any documentation on the patterns.  
Here is the code of the index.js file:

```js
panel.plugin("myproduct/base64image", {
  fields: {
    base64image: {
      props: {
        value: String
      },
      computed: {
        imageSrc() {
          return this.value && this.value.startsWith("data:image")
            ? this.value
            : `data:image/png;base64,${this.value}`;
        },
        screenShotTitle() {
          
          let productname = this.$parent.data.productname;
          let version = this.$parent.data.version;
          let buildnumber = this.$parent.data.buildnumber;

          // // Combine the fields to form a title
          let title = `${productname}_${version}_${buildnumber}`;
          return title;
        }
      },
      methods: {
        downloadImage() {
          if (!this.imageSrc) return;
          const safeTitle = this.screenShotTitle.replace(/[^a-zA-Z0-9-_]/g, "_");
          const link = document.createElement("a");
          link.href = this.imageSrc;
          link.download = `${safeTitle}-${new Date().toISOString().replace(/[:.]/g, "-")}.png`;
          document.body.appendChild(link);
          link.click();
          document.body.removeChild(link);
        }
      },
      template: `
        <div>
          <img v-if="imageSrc" :src="imageSrc" alt="Base64 Image"/>
          <p v-else>No image available</p>
          <button v-if="imageSrc" @click="downloadImage" class="k-button">
            Download Image
          </button>
        </div>
      `
    }
  }
});

```

Any help is very much appreciated!

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [April 7, 2025, 9:36pm UTC](https://forum.getkirby.com/t/panel-field-plugin-getting-the-value-of-sibling-fields-in-structure-field/33899/2 "2025-04-07T21:36:07Z")

</div>

Can’t really follow what you are trying to do with `this.$parent`. For Kirby 4, `this.$store` should be the right direction (this will change with Kirby 5 though).

```js
this.$store.getters["content/values"]()['myField']

```

didn’t get you anything? You were saying that it’s a structure field. So I assume `myField` in this example would be the name of the structure field. You would then need to locate the row of your current field, to find its sibling field.

---

<div class="post-metadata">

**Author:** ![memibeltrame](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/memibeltrame/32/4814_2.png) [@memibeltrame](https://forum.getkirby.com/u/memibeltrame)\
**Post date:** [April 8, 2025, 9:38am UTC](https://forum.getkirby.com/t/panel-field-plugin-getting-the-value-of-sibling-fields-in-structure-field/33899/3 "2025-04-08T09:38:57Z")

</div>

Hi @distantnative  
Thanks a lot, I was working under the assumption that this.$store was referencing the entry of the structure, since this.value refers to the value of the screenshot of the entry open in the side-sheet.  
In my tests I was therefore using this.$store.getters"content/values"[‘productname’] instead of this.$store.getters"content/values"[‘nameofstructure’]  
Thanks again!
