Fluorescent
Stiletto
Stiletto
  • Stiletto Help Center
    • Start using Stiletto
      • Theme licenses
      • Migrate your theme
    • FAQs
    • Video tutorials
    • Changelog
  • General
    • Editing themes
      • Adding sections
      • Using templates
      • Accessibility
      • Customizing your site
      • SEO for Shopify themes
      • H1 heading tags
      • Online store speed
    • Image guide
      • Web ready photography
      • Image sizes
      • File formats
      • Theme image settings
    • Adapting theme content
      • Edit default theme content
      • Multiple languages
      • Dynamic content with metafields
      • Unique content for markets
    • Update your theme
  • Theme styles
    • Theme settings
    • Style presets
      • Demo layouts
    • Fonts
    • Colors
    • Animation
  • Pages
    • Templates
      • About page
      • Blog page
      • Blog posts
      • Collections list
      • Contact page
      • Customer accounts
      • FAQ page
      • Lookbook
      • Password page
      • Search page
      • Store locations
      • 404 page
      • Home page
    • Announcement bar
    • Header
      • Layout and style
      • Logo
      • Transparent header
      • Mega menus
      • Mobile menu
      • Quick search
      • Language and currency
      • Social media icons
      • Customer account icon
    • Footer
      • Links block
      • Newsletter block
      • Text and image block
      • Language and currency
      • Payment icons
      • Custom Liquid
  • Sections
    • Theme sections
      • Using sections
      • Content blocks
      • Blog posts
      • Collapsible row list
      • Collection list grid
      • Collection list slider
      • Complete the look
      • Contact form
      • Countdown banner
      • Countdown bar
      • Events
      • Featured collection grid
      • Featured collection slider
      • Featured product
      • Gallery carousel
      • Grid
      • Image compare
      • Image hero
      • Image hero split
      • Image with text
      • Image with text split
      • Multi column
      • Newsletter
      • Newsletter compact
      • Promotion banner
      • Promotion bar
      • Quotes
      • Recently viewed products
      • Rich text
      • Sales banner
      • Scrolling content
      • Shoppable image
      • Shoppable image editorial
      • Slideshow
      • Testimonials
      • Video
      • Video hero
      • Video with text
    • Popups
      • Sign up popup
      • Age verification
      • Countdown popup
      • Promotional popup
  • Products
    • Product listings
      • Product card style
    • Prices and discounts
    • Product badges
    • Quick shop
  • Product pages
    • Product template
      • Alternate templates
      • Pre-order template
      • Gift card
    • Layout and style
      • Product tabs
      • Media gallery
      • Sticky product details
      • Breadcrumbs
      • Navigation buttons
    • Overview blocks
      • Default blocks
        • Description
        • Product header
        • Variant selector
        • Quantity selector
        • Buy buttons
        • Local pickup banner
        • Share icons
        • Sticky add-to-cart bar
      • Collapsible rows block
      • Complementary products
      • Custom options
      • Image block
      • Information popup
      • Product labels
      • Secure payment
      • Stock level indicator
      • Text block
      • Text list with icons
      • App blocks
    • Variant options
      • Variant chips
      • Variant swatches
        • Enable swatches
        • Use default colors
        • Use custom colors
        • Use variant images
        • Use custom images
        • Change swatch styles
        • Show on product cards
        • Dynamic option availability
      • Media grouping
      • Sibling product swatches
    • Product page sections
      • Product reviews
      • Product recommendations
  • Collection pages
    • Collection template
      • Collection landing
      • Sale collection
      • Subcollections
      • Flash sale
    • Banner
    • Product grid
    • Filters and sorting
  • Cart
    • Cart page
    • Quick cart
      • Added to cart popup
      • Empty cart promotion
    • Free shipping bar
    • Low inventory warning
    • Cross sells
  • Support
    • Support policy
    • Shopify vs Theme issues
    • Store access requests
  • For developers
    • Custom CSS
    • Custom fonts
    • Custom Liquid
    • Custom JavaScript events
    • Edit Theme JavaScript
Powered by GitBook
On this page
  • Add Custom Liquid section
  • Add anchor links to sections

Was this helpful?

  1. For developers

Custom Liquid

Advanced

Last updated 4 months ago

Was this helpful?

We do not support code customizations. This guide offers a basic reference for developers and advanced users familiar with HTML and Liquid. Always test code changes on unpublished theme copies. For assistance, we recommend reaching out to a .

With the Custom Liquid setting, you can extend your theme by adding snippets of Liquid or HTML code as a block or section in the theme editor.

The Custom Liquid section provides a reliable and safer option compared to directly editing your theme code. It will help keep your theme copy eligible for updates and avoid code conflicts.

Liquid is the template language used by Shopify. See their to learn more. Also check out Shopify's .

Add Custom Liquid section


Click (+) Add section and select Custom Liquid. Use the drag-and-drop handles ⋮⋮ to re-order blocks. Click the section to start customizing.

Add anchor links to sections


Shopify dynamically generates ids for sections but these ids are not stable. The following instructions are a workaround for this platform limitation.

To link to a specific section on a page, you can use a Custom Liquid section with some HTML as a workaround. The HTML will include a special id property that will allow you to link directly to that section.

Once set up, the Custom Liquid section will not affect the page layout.

Anchor link in the Header doesn't work?

If your anchor link in the navigation menu points to a section on the same page, you will need to disable page transitions for the link to work. Go to Theme settings > Animation and deselect Enable page transitions.

STEPS

In your theme editor (Customize):

  1. Under Template, click (+) Add section and select Custom Liquid.

  2. Click and hold the drag and drop handles ⋮⋮ to move the Custom Liquid section directly above the section you want to link to.

  3. Click the Custom Liquid section to open the settings.

  4. Enter the following HTML code and enter a unique id property in the opening tag. If using multiple words, you must use dashes (-) instead of spaces.

    <span id="our-values"></span>

    Recommended: Use an ID that's the same name as your section, and make sure the name is not used by other IDs.

  5. Under Section style, set the Padding to None.

  6. Find and click the section or block that will link to the Custom Liquid section.

  7. In the link field, enter the id with a hashmark at the start (e.g. #our-values).

    To link from another page or menu link, you must enter the full URL path with the anchor link at the end (e.g. www.store.com/#our-values or www.store.com/about#our-values).

  8. If adding the anchor link to the navigation menu, you will need to disable Page transitions in Theme settings > Animation. Otherwise, the link will not work for sections that are on the current page.

  9. Click Save.


Related links

verified Fluorescent partner
Liquid reference guide
Liquid code examples
Edit theme JavaScript
Custom Liquid
Custom CSS
Custom fonts