Viewport Macro?

Amanda Ford asked on July 10, 2014 08:13

I'm using the UniPager web part to show paging. I'd like to display 8 items per page if the viewport is greater than 1199 pixels, else display 6 items.

Is there a macro that detects the viewport width? If not, anyone have an idea how to accomplish this?

{% if (somemacro> 1199) { return 8 } else { return 6 } %}

Correct Answer

Brenden Kehren answered on July 10, 2014 12:13

I don't believe there is. You could use the examples in this post and create your own macro.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Chetan Sharma answered on July 10, 2014 10:47

Check for this http://devnet.kentico.com/docs/7_0/devguide/index.html?mobile_device_macro_reference.htm

0 votesVote for this answer Mark as a Correct answer

Amanda Ford answered on July 10, 2014 10:53

Thanks Chetan, but it doesn't look like any of these are for the viewport. ScreenPixelsWidth will give me the width of the device, but not the browser window.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.