Chaining multiple commands in one {% %} set

Topic summary

A user encountered issues trying to assign multiple variables within a single {% %} template tag block. The initial attempt to chain multiple assign statements in one bracket set was not working.

Solution Found:
The user resolved the problem by switching to the {% liquid %} tag, which allows multiple commands to be executed sequentially within a single block:

  • Enables multiple assign statements without closing and reopening tags
  • Supports cleaner syntax for chaining template operations

The working solution uses {% liquid %} followed by multiple assign commands for variables like productswidth, pageswidth, loop, and buttonURL.

Summarized with AI on November 23. AI used: claude-sonnet-4-5-20250929.

I found a solution:

{% liquid
assign productswidth = '100%'
assign pageswidth = '60%'
assign loop = false
assign playbutton = "URL"
%}