{"title":"Global Variables","slug":"global-variables","url":"https://support.storeconnect.com/articles/global-variables","url_markdown":"https://support.storeconnect.com/articles/global-variables.md","subtitle":null,"summary":"Define and reference Liquid theme controller variables that are available across all pages, templates, and content blocks, with static and dynamic assignment examples.","type":"Developer_Documentation","video_url":"","keywords":"liquid, global variables, theme controller, liquid variables, controller variables, server-side variables, session variables, variable assignment, liquid themes, static variables, dynamic variables, cross-page variables","last_modified":"2026-08-21T07:12:35+0000","body_markdown":"Liquid theme controller variables are globally accessible variables defined in a theme controller. They can be referenced across all parts of the theme, including pages, templates, and content blocks. These variables support static or dynamic assignment, and they support value reassignment.\n\nExample:\n\n```text\n\ncontrollers/theme\n```\n\n\n```liquid\n\n{% liquid\n   variables store_name: \"Acme Store\"\n%}\n```\n\n\nReference your variable:\n\n\n```liquid\n\n{{ store_name }}\n```\n\n\nOutput:\n\nAcme Store\n\n### **Important Notes**\n\nGlobal variables are part of a controller's actions and can only be declared within a controller file. One of their primary uses is to assign or reassign dynamic values.\n\nYou can reference theme controller variables anywhere in your theme, including within content objects like pages and content blocks. It's important to note that these variables are different from session variables: theme controller variables operate at the theme and server-side level, meaning their values are consistent across all users. In contrast, session variables are tied to an individual user's session and are only valid during that session.\n\n### **Definitions**\n\n**Controllers:** In liquid themes, a controller is a theme component that helps to define and control global data or theme-related behavior at a server-side level.\n\nServer-side: Refers to data management that happens on the server before the theme is rendered and delivered to the user's browser."}