Home>Support>Column count inside Widget

Column count inside Widget

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

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 2 months ago Alex S
    Hi, I Work Here

    Hi Jan,

    I’ve forwarded this thread to the development team. You should hopefully hear back from them or me, soon.

  2. 9 years, 2 months ago Jan Reiland

    Alright, thank you Alex. I’m looking forward to hearing from you.

    Greetings

  3. 9 years, 2 months ago Greg Priday
    Hi, I Work Here

    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.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More