Column count inside Widget
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
This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
3Hi 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.
Replies on this thread are closed.
Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.