XF 2.2 Pass data to overlay

Finexes

Well-known member
Hey guys,

I know that I can set e.g. a class for an overlay via data-overlay-config="{{ {'className':'customClass'}|json }}". Is it also possible to pass custom content to an overlay?
 

Finexes

Well-known member
Alright, I found a solution: Basically you can wrap your desired content in a div, for example:

HTML:
<div class="selector">
    <div class="overlay-title">
        Title
    </div>
    <div class="overlay-content">
        Overlay content
    </div>
</div>

Then you can pass this content to your overlay via data-xf-click="overlay" data-target=".selector". Don't forget to add display: none; to .selector.

This is something I can live with, but I'd appreciate it, if there's someone with a more elegant solution :)
 
Top