Created
May 5, 2021 09:11
-
-
Save kowsar89/db7b3e5e5453c7c86a73b659c9607eb7 to your computer and use it in GitHub Desktop.
form-builder-data-structure.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// meta_key = field_key | |
// relation_key = key >> original_widget_key | |
// original_widget_key isn't available for fields which isn't related to form | |
var submission_form_fields = { | |
fields: { | |
title: { | |
label: 'Title', | |
field_key: 'listing_title', | |
widget_group: 'preset', | |
widget_name: 'title', | |
widget_key: 'title', | |
}, | |
text: { | |
label: 'Text ', | |
field_key: 'custom-text', | |
widget_group: 'custom', | |
widget_name: 'text', // field type | |
widget_key: 'text', | |
}, | |
text_2: { | |
label: 'Text 2', | |
field_key: 'custom-text-2', | |
widget_group: 'custom', | |
widget_name: 'text', | |
widget_key: 'text_2', | |
}, | |
}, | |
groups: [ | |
{ | |
label: 'General', | |
type: 'general_group', | |
fields: [ 'title', 'text', 'text_2' ], | |
}, | |
], | |
}; | |
var single_listings_contents = { | |
fields: { | |
text: { | |
icon: 'fa fa-home', | |
widget_group: 'preset_widgets', | |
widget_name: 'text', // field type | |
widget_key: 'text', | |
original_widget_key: 'text', // relation = form key | |
}, | |
text_2: { | |
icon: 'fa fa-car', | |
widget_group: 'preset_widgets', | |
widget_name: 'text', | |
widget_key: 'text_2', | |
original_widget_key: 'text_2', | |
}, | |
}, | |
groups: [ | |
{ | |
label: 'General', | |
type: 'general_group', | |
custom_block_classes: '', | |
custom_block_id: '', | |
fields: [ 'text', 'text_2' ], | |
}, | |
{ | |
label: 'Related Listings', | |
type: 'widget_group', | |
widget_group: 'other_widgets', | |
widget_name: 'related_listings', | |
custom_block_classes: '', | |
fields: [], | |
}, | |
], | |
}; | |
var search_form_fields = { | |
fields: { | |
title: { | |
label: '', | |
widget_group: 'available_widgets', | |
widget_name: 'title', // field type | |
widget_key: 'title', | |
original_widget_key: 'title', // relation = form key | |
}, | |
category: { | |
label: '', | |
widget_group: 'available_widgets', | |
widget_name: 'category', | |
widget_key: 'category', | |
original_widget_key: 'category', | |
}, | |
location: { | |
label: '', | |
widget_group: 'available_widgets', | |
widget_name: 'location', | |
widget_key: 'location', | |
original_widget_key: 'location', | |
}, | |
text: { | |
label: 'Text', | |
widget_group: 'available_widgets', | |
widget_name: 'text', | |
widget_key: 'text', | |
original_widget_key: 'text', | |
}, | |
text_2: { | |
label: 'Text 2', | |
widget_group: 'available_widgets', | |
widget_name: 'text', | |
widget_key: 'text_2', | |
original_widget_key: 'text_2', | |
}, | |
radius_search: { | |
label: 'Text 2', | |
widget_group: 'other_widgets', | |
widget_name: 'radius_search', | |
widget_key: 'radius_search', | |
}, | |
review: { | |
label: 'Review', | |
widget_group: 'other_widgets', | |
widget_name: 'review', | |
widget_key: 'review', | |
}, | |
}, | |
groups: [ | |
{ | |
label: 'Basic', | |
type: 'general_group', | |
custom_block_classes: '', | |
custom_block_id: '', | |
fields: [ 'title', 'category', 'location' ], | |
}, | |
{ | |
label: 'Advanced', | |
type: 'widget_group', | |
widget_group: 'other_widgets', | |
widget_name: 'related_listings', | |
custom_block_classes: '', | |
fields: [ 'radius_search', 'review', 'text', 'text_2' ], | |
}, | |
], | |
}; | |
var listings_card_grid_view = { | |
active_template: 'grid_view_with_thumbnail', | |
template_data: { | |
grid_view_with_thumbnail: { | |
thumbnail:{ top_right:[], top_left:[], bottom_right:[], bottom_left:[], avatar:[] }, | |
body:{ | |
top:[], | |
bottom:[ | |
{ | |
type:"list-item", | |
label:"Text 1", | |
widget_name:"text", // field type | |
widget_key:"text", | |
original_widget_key:"text", // relation = form key | |
icon:"uil uil-text-fields", | |
show_label:false | |
}, | |
{ | |
type:"list-item", | |
label:"Text 2", | |
widget_name:"text", | |
widget_key:"text_2", | |
original_widget_key:"text_2", | |
icon:"uil uil-text-fields", | |
show_label:false | |
}, | |
{ | |
type:"list-item", | |
label:"Checkbox 2", | |
widget_name:"checkbox", | |
widget_key:"checkbox_2", | |
original_widget_key:"checkbox_2", | |
icon:"uil uil-text-fields", | |
show_label:false | |
}, | |
{ | |
type:"list-item", | |
label:"Checkbox 1", | |
widget_name:"checkbox", | |
widget_key:"checkbox", | |
original_widget_key:"checkbox", | |
icon:"uil uil-text-fields", | |
show_label:false | |
} | |
], | |
excerpt:[] | |
}, | |
footer:{ | |
right:[], | |
left:[] | |
} | |
} | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment