Skip Navigation

[Resolved] Dynamic offset in views ?

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to dynamically allocate an offset to the view based on a url parameter.

Solution:

To pass the offset to the view all you need to do is add the offset="2" value to the shortcode as a shortcode attribute.

Then you can use this shortcode to pass the attribute.
https://toolset.com/documentation/user-guides/views-shortcodes/#vf-214940

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Shane 6 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#919945

I need to pass an offset value to a view. I need to start a slideshow at specific position. I think to use the offset but I need to pass the value and use it.
Try to find something related to views API / hooks but I don't find info.
Please help me.

#920045

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Cristian,

Thank you for contacting our support forum.

Is it that you want to dynamically pass an offset to the view ? or is it that you want to get the offset value from the view.

To pass the offset to the view all you need to do is add the offset="2" value to the shortcode as a shortcode attribute.

Thanks,
Shane

#920392

This is fine:

To pass the offset to the view all you need to do is add the offset="2" value to the shortcode as a shortcode attribute.

but hot to pass the offset value as a URL param ?

It's possible ?

#920414

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Cristian,

So you want to pass the offset value from the URL into the view correct?

What you can do is to try this shortcode and pass it into the offset attribute.
https://toolset.com/documentation/user-guides/views-shortcodes/#vf-214940

Please let me know if this helps.

Thanks,
Shane