Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].
Hi, i’m developing my own widgets and i would like to know, if there is a chance to get the number of columns where the user placed the widget.
For example, if i have my own image widget, i would like to know, if it is placed inside a one column or five column layout, so i can serve the right image size.
Thanks again for this great plugin.
Cheers
Hi Jan,
I’ve forwarded this thread to the development team. You should hopefully hear back from them or me, soon.
Alright, thank you Alex. I’m looking forward to hearing from you.
Greetings
Hi Jan
This would technically be possible. Each widget has access to some information through the panels_info array key in the $instance argument. The cell_index key is what would be most useful to you.
https://github.com/siteorigin/siteorigin-panels/blob/develop/siteorigin-panels.php#L986
The best thing you can do is var_dump the $instance value in your widget and check all the values available to you. From there, you can figure out which ones offer the most valuable information to you.