Jul 23, 202110:25 AM - edited Jul 23, 202111:04 AM
Top Contributor | Platinum Partner
Control default number of objects in module when included in template
Hello @BGrennan ! Thank you for posting in the forum, As far as I am concerned this is not possible as the default number of objects is defined in the module itself so any instance of that module will carry that information throughout its lifespan. One thing you could possibly do is make some template-level defaults, if you show us what does the module look like I could help you with the hubl code, but basically its between these lines:
{# This is how it would look if you had a group with repeatable items #}
{% dnd_module
"zig-zag-posts"
path="/theme/modules/zig-zag",
label="zig-zag posts",
your_objects_name = [
{"object_field": "some value"},
{"object_field": "another value"},
{"object_field": "one more value"}
]
%}
{% end_dnd_module %}
{# and thats whith just a repeatable item #}
{% dnd_module
"zig-zag-posts"
path="/theme/modules/zig-zag",
label="zig-zag posts",
your_objects_name = [
"some value",
"another value",
"one more value"
]
%}
{% end_dnd_module %}
So you may have defined a default of 5 objects but with this code your template will show the three you have defined here. This is called template-level default value and it overrides the default value you put in your module. More info on using modules in templates here,