# Ajax-Modal mit eindeutiger ID?

**URL:** <https://forum.shopware.com/t/ajax-modal-mit-eindeutiger-id/88596>\
**Category:** Shopware 6 (German)\
**Created:** [24. Juni 2021 um 13:25 UTC](https://forum.shopware.com/t/ajax-modal-mit-eindeutiger-id/88596 "2021-06-24T13:25:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel-hauke.adam](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@daniel-hauke.adam](https://forum.shopware.com/u/daniel-hauke.adam)\
**Post date:** [24. Juni 2021 um 13:25 UTC](https://forum.shopware.com/t/ajax-modal-mit-eindeutiger-id/88596/1 "2021-06-24T13:25:18Z")

</div>

Moin,

ich habe grade die Situation, dass ich mehrere Modale auf einer Seite habe, die ich unterschiedlich gestallten will. Doch ich weiß aktuell nicht, wie ich die Modale auseinander halten kann. Ich benutze diese Methode: [https://developer.shopware.com/docs/guides/plugins/plugins/storefront/using-a-modal-window#create-a-modal-using-ajax-modal-utility](https://developer.shopware.com/docs/guides/plugins/plugins/storefront/using-a-modal-window#create-a-modal-using-ajax-modal-utility).  
Weiß jemand, wie ich so eine eindeutige ID an die Modale vergeben kann oder die sonst identifizier mache?

---

<div class="post-metadata">

**Author:** ![Krischan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/krischan/32/21523_2.png) [@Krischan](https://forum.shopware.com/u/Krischan)\
**Post date:** [13. August 2023 um 10:56 UTC](https://forum.shopware.com/t/ajax-modal-mit-eindeutiger-id/88596/2 "2023-08-13T10:56:27Z")

</div>

Hallo Daniel,

ich stand vor einem ähnlichen Problem. Im Skript für das Ajax-Modal ([https://github.com/shopware/storefront/blob/trunk/Resources/app/storefront/src/plugin/ajax-modal/ajax-modal.plugin.js](https://github.com/shopware/storefront/blob/trunk/Resources/app/storefront/src/plugin/ajax-modal/ajax-modal.plugin.js)) findest du das Attribut „data-modal-class“. Damit sollte es funktionieren.

Setze einfach deinem Link data-modal-class=„deine\_eindeutige\_id“ hinzu und das Modal sollte die angegebene Klasse übernehmen.

Ich hoffe, das hilft weiter.

```auto
<a data-toggle="modal1" data-bs-toggle="modal" data-modal-class="Unique_ID" data-url="/widgets/cms/PAGE_ID" href="/widgets/cms/PAGE_ID" title="Modal-Test">Modal-Test</a>

```

Auch wenn es jetzt ein wenig spät ist 😉
