Hi,
This is what I’d do. I would create a dropdown field as part of my photo weblog fields and then populate it with numbers like 1-20. Alternatively, I’d create a field [text input] where users specify the number of photos they want to see. But it is safe with a dropdown since they will just select a number unlike entering garbage data. Weblog call as follows:
Say the field name is number_of_photos
{exp:weblog:entries weblog=“photos” limit=”{number_of_photos}”}
If by any chance the limit parameter is not regarded as a number since it might be from text field, I’d then use php to convert the value either entered or selected into an interger, because whatever you pass to limit should be an interger, I guess. Conversion like this
<?php
$no_of_photosStr = “{number_of_photos}”;
$no_of_photosInt = (int)$no_of_photosStr;
?>
Then weblog call as follows:
{exp:weblog:entries weblog=“photos” limit=”<?=$no_of_photosInt?>”}
You might need to run php on input if nothing happens after this code has been used.
Regards,
Marks