Shopify/Liquid Global Objects
Global liquid variables
This is the complete list of the global objects available on the template engine. Initially, the global objects can be grouped by:
- Verification variables: Information about the current page;
- User/Account variables: Information about the user and the knowledge base account;
- Template variables: Information related to the template;
- Content related variables: Information related to the most useful groups of content.
Verification variables
Information about the current page, useful to create html class names to control different design for different page types and to create Contextual Sections.
- on_show_question_page: Variable that returns a true value if the current page is a question;
- on_index_page: Variable that returns a true value if the current page is the index page;
- on_contact_us_page: Variable that returns a true value if the current page is the contact-us page;
User/Account variables
Information about the user and the knowledge base account. Useful to create internal navigation links and control different design for different user accounts.
- account: Object that returns a list of properties related to the KB account;
- account.name: Text Object that returns the account name;
- account.main_js_url: Text Object that returns the main_js file address;
- account.main_css_url: Text Object that returns the main_css file address
- internal_kb_user: Object that contains the info on the logged in user;
- current_user: Same as internal_kb_user;
- current_user.first_name: Text Object that returns the user's first name;
- current_user.last_name: Text Object that returns the user's last name;
- current_user.email: Text Object that returns the user's email address;
- current_user.role_id: Text Object that returns the user's role (Admin, Viewer etc);
Template variables
Information related to the template. Needed to integrate the default scripts on the template and include the specific code for each page.
- javascript_includes: This Object is specific for the template and it returns a string containing the main JS;
- responsivemenu_js: This Object is specific for the template and it returns a string containing the javascript files responsible for the mobile menu;
- typewatch_js: This Object is specific for the template and it returns a string containing the javascript files responsible for the monitoring of the search block;
- questions_js: This Object is specific for the template and it returns a string containing the javascript files responsible for the fetching and displaying of questions after performing a search;
- default_main_js: This Object is specific for the template and it returns a string containing the default main js file.
- main_js: This Object is specific for the template and it returns a string containing the custom js file. See more about this file here.
- main_css: This Object is specific for the template and it returns a string containing the custom css file. See more about this file here.
- content_for_layout: This Object fetches the contents on the current page as a text and paste it over the template code
Content related variables
Information related to the most useful groups of content. Useful to create the standard sections. See more about the Standard Sections.
- recent_updates: Returns a list with the 20 recently updated/created questions;
- root_questions: Returns a list with the all questions on the root level (the dashboard);
- categories: Be careful this object fetches all the categories under your KB, non-exclusively, which means that you would also get all the child categories;
- roots_categories: A more focused object returns only the immediate categories under your KB;
- top_questions: Returns a list with the 20 most frequently visited questions;
- most_popular_questions: Returns the exact same list;
- latest_questions: Returns the 20 recently updated questions.