Creating your own elements with code

Let’s say I create a gallery with database connections and filters and a lot of code as well. I named the gallery pageGallery.

It would be awesome if I could attach the code to that pageGallery and save the whole object with code as a Private Site Wide Element that I can reuse on my site wherever I want to.

If I could set public properties on that as well so when I want to inject in somewhere I just write
$w(’siteGallery’).SetProperty(’filterValue’, ’cars’)
That is a public property that I can use in the code of the function with the value of cars.

Then when setup is done I can insert it before or after some other object on the page like this.

$w(’siteGallery’).InsertBefore(’columns11’);

$w(’siteGallery’).InsertAfter(’columns11’);

This would blow everyone away. Thenn I as a developer can make my own elements and maybe in a future share them on some kind of marketplace for shared elements.