LayoutHub
  • What is LayoutHub?
  • User guides
    • Support
    • Installation
    • Uninstallation
    • Upgrade/Downgrade
    • FAQs
      • How to remove instagram section from Layouthub
      • What is "Pages limit"?
      • When can I "Edit code"?
      • What about "Save section"?
      • What is " Auto save draft"?
      • What is "Integration Services"?
      • How to set the same font between Shopify and LayoutHub?
      • How to custom font and color on LayoutHub?
      • How to set "Page handle or human url"?
      • Connective Button
      • How to save page without publish it
      • How to change the meta SEO for LayoutHub's page
    • Common Issues
    • Layout Management
      • Create Layouts
      • Design Blocks
      • Export & Import
      • Edit Section Code
      • Edit a Layout
      • Assign a Layout
      • Duplicate a Layout
      • Delete a Layout
    • Section builder
    • LayoutHub pages/templates
      • Home Page
        • Create additional Home Page
        • Make an existing page as home page
        • Restore to default Home Page
        • Customize Shopify Home Page
      • Sub-page
        • Contact Form
      • Product Template
        • Product Detail
        • Related Product
      • Collection Template
      • Blog Templates
      • Article Templates
      • Insert section
    • Pricing Plans
    • Settings
      • General
      • Theme Settings
      • Quickview Settings
      • Swatch color settings
      • Third party Apps
        • Product Review
        • Product Wishlist
    • Trash
    • Sale Tools
    • Referrals
    • Integration
      • Add/Edit Profile
      • Add New Contact
      • Export Contact
      • Mailchimp
      • Hubspot
      • ActiveCampaign
      • GetResponse
      • SendGrid
      • Gmail SMTP
      • Google Sheets
      • Omnisend
      • Klaviyo
      • ConvertKit
    • Tracking & Analytics
    • Layouthub & Shopify
    • Translate Apps
    • Recommend apps
      • Avada SEO Optimization
      • Ali Reviews ‑ Product Reviews
      • Ryviu: Product Reviews App UGC
      • Quick View by Secomapp
      • LAI AliExpress Reviews
      • Judge.me Product Reviews
      • Growave - Loyalty, Wishlist, Reviews UGC
      • Opinew Product Reviews
    • Refund Policy
    • Instagram token
  • Development
    • Getting started
    • Tools
      • LayoutHub Kit (for LayoutHub developers only)
      • LayoutHub Kit Extension for Visual Studio Code
    • Layout Structure
    • Reference
      • Engine syntax
        • Deprecated: March 2020
        • Chuẩn template má»›i - LayoutHub Editor V4
      • Create a section
      • Components
      • Liquid in section
      • Javascript in section
      • Register vendors
      • Settings.js
        • Call-to-action
        • Text
        • Textarea
        • Text Editor
        • Dropdown
        • Checkbox list
        • Checkbox radio
        • Toggle
        • Number slider
        • Number
        • Single image
        • Image library
        • Color picker
        • Icon picker
        • Font picker
        • Background
        • Picker
        • Group fields
Powered by GitBook
On this page
  • Arguments
  • Code example for
  • Code example for

Was this helpful?

  1. Development
  2. Reference
  3. Settings.js

Picker

This field allow you get data from Shopify store, Example: Get list products,collections,menu ....

Arguments

Name

Type

Value

Description

type

string

picker

The type of setting

name

string

{field_name}

The unique name will be used in template

label

string

(optional)

The label that appears above of the setting field.

description

string

(optional)

The description that appears above under of the setting field.

tooltip

string

(optional)

The long description that appears on the tooltip when hover on.

value

object

(optional)

The default value will be used for the first time.

on

object

(optional)

Add listener events for setting field

options

object

required

{

"button_text": 'Browse menu',

"multiple": false, /* Allow select multi items */

"search": true, /* Customer can search items */

"type": 'menu', /* menu,collection,product,page,blog,article */

"title": 'Menu',

"layout": 'list', /* gird,list */

"default": 'main-menu'

}

Code example for

@schema
{
	"name"		: "Picker",
	"author"	: "LayoutHub Team",
	"website"	: "https://www.LayoutHub.com"
}
@endschema


<div class="sample-demo">
	<p>Hello picker</p>
	  @liquid('menu')
	
</div>
[
    {
        name: 'menu',
        label: 'Select menu',
        type: 'picker',
        value: [],
        "options": {
            "button_text": 'Browse menu',
            "multiple": false,
            "search": true,
            "type": 'menu', // menu,collection,product,article,blog,page
            "title": 'Menu',
            "layout": 'list',
            "default": 'main-menu'
        }
    }
]
{
	"menu" :{
		"raw":<<EOF
			
			@if(section.settings.menu && section.settings.menu.length)
				{% assign menu  =  linklists['@print(section.settings.menu[0].value)'] %}
				Menu name: {{ menu.title }}
				{% for link in menu.links %}
				  <a href="{{ link.url }}"
				    {% if link.current %}aria-current="page" class="highlight"{% endif %}
				  >
				   {{ link.title }}
			  </a>
			{% endfor %}
			@endif
		EOF,
		"content":"Default value"
	}
}

Code example for

@schema
{
"name" : "Picker",
"author" : "LayoutHub Team",
"website" : "https://www.LayoutHub.com"
}
@endschema


<div class="sample-demo">
<p>Hello picker</p> 
@print(section.settings.menu)

</div>
[
    {
        name: 'menu',
        label: 'Select menu',
        type: 'picker',
        value: [],
        "options": {
            "button_text": 'Browse menu',
            "multiple": false,
            "search": true,
            "type": 'page', //  'page', 'images', 'fonts', 'categories', 'posts', 'post_type', 'object_taxonomies', 'form_integration', 'woo_categories', 'woo_products'
            "title": 'Menu',
            "layout": 'list',
            "default": 'main-menu'
        }
    }
]
PreviousBackgroundNextGroup fields

Last updated 5 years ago

Was this helpful?

Download the sample file below and unzip in the developer direction. If you still have not activated developer mode, .

click here
20KB
picker.zip
archive