This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Column count inside Widget

9 years ago · Last reply by Greg Priday 9 years ago

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

3
  1. Alex S Staff 9 years, 9 months ago

    Hi Jan,

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

  2. Jan Reiland 9 years, 9 months ago

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

    Greetings

  3. Greg Priday Staff 9 years, 9 months ago

    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.

Have a different question or issue?

Start New Thread