I need help, I can’t overwrite the default values, I don’t know what I’m doing wrong
Follow the code below
calling module in template
{% dnd_module 'buttons-stores', path="./../modules/buttons-stores" %}
{% module_attribute "spacing" is_json=True %}
{
"spacing_bottom": 0,
"spacing_top": 100
}
{% end_module_attribute %}
{% end_dnd_module %}
module fields.json file
[
{
"label": "Buttons-stores",
"name": "buttons_stores",
"required": false,
"locked": false,
"occurrence": {
"default": 2,
"min": 1
},
"children": [
{
"id": "item_menu.name",
"type": "text",
"label": "Name Item",
"name": "name_item",
"validation_regex": "",
"allow_new_line": false,
"show_emoji_picker": false,
"type": "text",
"default": "App store"
},
{
"id": "item_menu.path_local_item",
"type": "text",
"label": "Path local",
"name": "path_local_item",
"type": "text",
"default": "./../../images/icons/app_store.svg"
},
{
"id": "item_menu.url",
"type": "text",
"label": "URL Item",
"name": "url_item",
"validation_regex": "",
"allow_new_line": false,
"show_emoji_picker": false,
"type": "text",
"default": "#"
},
{
"id": "item_menu.src",
"type": "image",
"required": false,
"locked": false,
"responsive": true,
"resizable": true,
"show_loading": false,
"label": "src Item",
"name": "src_item",
"default": {
"size_type": "exact",
"src": "",
"alt": "image-alt-text",
"loading": "lazy",
"width": 128,
"height": 128,
"max_width": 128,
"max_height": 128
}
},
{
"id": "item_menu.target",
"type": "boolean",
"display": "checkbox",
"label": "Target Blank",
"name": "target_blank_item",
"allow_new_line": false,
"show_emoji_picker": false,
"default": true
}
],
"type": "group",
"default": [
{
"name_item": "App store",
"src_item": "",
"url_item": "https://www.apple.com/br/app-store/",
"target_blank_item": true,
"path_local_item": "./../../images/icons/app_store.svg"
},
{
"name_item": "Google Play",
"src_item": "",
"url_item": "https://play.google.com/",
"target_blank_item": true,
"path_local_item": "./../../images/icons/google_play.svg"
}
]
},
{
"label": "Spacing",
"name": "spacing",
"required": false,
"locked": false,
"type": "group",
"children": [
{
"label": "Spacing Bottom",
"name": "spacing_bottom",
"type": "number"
},
{
"label": "Spacing Top",
"name": "spacing_top",
"type": "number"
}
],
"default": {
"spacing_bottom": 0,
"spacing_top": 0
}
}
]
In the panel I can change the spacing_bottom and spacing_top but in the module_attribute I can’t
