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
  • 1. Turn-off migration mode for dev
  • 2. New CSS Variable
  • 3. Using @print() for inner text only
  • 4. Use @attr() for attribute
  • 5. Use @lang() for inner text only

Was this helpful?

  1. Development
  2. Reference
  3. Engine syntax

Deprecated: March 2020

The new syntax has been applied since March, some of old code will be deprecated.

PreviousEngine syntaxNextChuαΊ©n template mα»›i - LayoutHub Editor V4

Last updated 4 years ago

Was this helpful?

1. Turn-off migration mode for dev

From url of editor, add the param &migration=no The editor will stop moving the old syntax and display errors with error correction instructions.

2. New CSS Variable

Using global CSS variable for faster and cleaner code. View more detail

style.css
// Old code
.myelm {
    color: %color%;
}

// New code
.myelm {
    color: var(--lh-color);
}

3. Using @print() for inner text only

β€ŒUse a formal syntax to print out. β€‹β€‹πŸ“Œ

section.lh
// Old code 
<h1>{{section.settings.}}</h1>

// New code
<h1>@print(section.settings.title)</h1>
// Escape html code
<h1>@print( esc(section.settings.title) )</h1>

4. Use @attr() for attribute

section.lh
// Old code 
<h1 class="{{section.settings.class}}">This is </h1>

// New code, 
// The value will be escaped automatically so do not need to use esc() here
<h1 class="@attr(section.settings.class)">This is heading</h1> 

5. Use @lang() for inner text only

Support multiple languages text, It works similar to the function @print()

section.lh
<h1>@lang(section.settings.head_text)</h1>

<h1>@lang( esc(section.settings.head_text) )</h1>

<h1>@lang('This is text supported ')</h1>

<a href="#" title="@attr( lang(section.settings.title) )">
 ... 
</a>

Use @attr() for print out the escaped variable in attribute of HTML . β€‹β€‹πŸ“Œ

If you love LayoutHub, could you consider posting an review? That would be awesome and really help us to grow our business, here is the.

πŸ“Œ
View more detail
View more detail
link