XModPro

Limit number of results / Module Parameters / stored procedures

 Fenske Fenske posted Mar 30, 2015
Active Apr 2 · Viewed 2594 times

Hi Xmod pros,

I know that I can place limits on the number of items returned to a template by using SQL constructs such as SELECT TOP 30, etc. 

As I mostly use stored procedures as the data source for my templates, I end up needing to pass a parameter to control how many rows would be returned when I need to limit them. I've used the URL query string parameters to set that value, and also used Module configuration parameters to set that parameter when the module gets placed on the page, i.e.:

<Parameter Name="NumberOfResults" Value='[[Module:NumberOfResults]]' />

That method is ideal, but would there be any way for me to set a default value for the that parameter if whoever adds the module to the page does not configure a "NumberOfResults" value in the module settings? I've set a default value for the parameter in my stored procedure, essentially making it optional there. Just hoping there would be a way to do something similar  with the Module Parameter?

Thanks for your thoughts! David

4 Replies

Loading replies...