Shopify/Liquid Complete Objects Reference

All liquid variables

This is the Complete Object Reference. For specific objects, check the grouped version:


Global Objects:

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, 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.


Category Objects:

This is the complete list of the category attributes available on the template engine.

  • category.id: Identification number of said category;
  • category.name: Retrieve a String with the full name of the question;
  • category.description:
  • category.image_url:
  • category.is_internal?: Boolean value returns true if the question is indeed internal;
  • category.has_children?: Boolean value, assumes true if the current category have subcategories.
  • category.show_all_questions_link: URL Slug text starting imidiately after the domain;
  • category.category_link: A anchor tag with name and href to the category;
  • category.url: URL Slug text starting imidiately after the domain;
  • category.number_of_questions:
  • category.created_at:
  • category.updated_at:
  • category.root: Return a single object parent to the current category;
  • category.parent: Return a single object parent to the current category;
  • category.ordered_subcategories:
  • category.published_questions: List of published questions in this category, subcategories not included;
  • category.published_questions_by_id: returns the questions object ordered by ID;
  • category.all_self_and_descendants: List of category objects with children and the current category it self;
  • category.descendants: List of category objects containing all the children and beyond categories;
  • category.children: List of category objects containing all the children and beyond categories;
  • category.number_of_questions: quantity of questions inside this category, subcategories not included, can be replaced by {{category.questions.size}};
  • category.questions: List of all questions in this category, subcategories not included;


Question Objects:

This is the complete list of the question attributes available on the template engine.

  • question.id: Identification number of said question;
  • question.name: Retrieve a String with the full name of the question;
  • question.description: This is the question subtitle;
  • question.category: Fetch the parent category to the specific question and returns as a object;
  • question.default_slug: URL Slug text for the question;
  • question.codename: Same as question.default_slug;
  • question.question_link: HTML A tag used to reference the question;
  • question.url: URL Slug text starting immediately after the domain;
  • question.votes: Sum quantity of feedback votes;
  • question.positive_votes: Positive votes quantity only;
  • question.negative_votes: Negative votes quantity only;
  • question.feedback_url: Used in the feedback form, more details here;
  • question.answer_sample: A tiny piece of the question text, 90 first chars;
  • question.long_answer_sample: A small piece of the question text, 350 first chars;
  • question.views: Views quantity;
  • question.readings: Readings quantity;
  • question.published_date: The complete date of publication (hour included);
  • question.is_internal: Boolean value returns true if the question is indeed internal;
  • question.is_internal?: Same as question.is_internal;
  • question.first_published_date: The complete date of publication;
  • question.last_updated: The complete date of the most recent update (hour included);
  • question.author_first_name: The authors first name;
  • question.author_last_name: The authors last name;
  • question.updated_by: See the object reference below;
  • question.created_by: See the object reference below;
  • question.related_questions: Returns a list of question objects with similar location;
  • question.show_tags: Comma separated list of tags for the question;
  • question.tag_names: A list with the tags for the question;
  • question.answers.first: See the object reference below;
  • question.answers: Retrieve a Long String with the text;


question.updated_by:

  • question.updated_by.first_name: First name of the user which updated the question the last time;
  • question.updated_by.last_name: Last name of the user which updated the question the last time;
  • question.updated_by.email: Email address of the user which updated the question the last time;
  • question.updated_by.role_id: User role of the user which updated the question the last time;


question.created_by:

  • question.created_by.first_name: First name of the user which first created the question;
  • question.created_by.last_name: Last name of the user which first created the question;
  • question.created_by.email: Email address of the user which first created the question;
  • question.created_by.role_id: User role of the user which first created the question;


question.answers.first:

  • question.answers.first.user:
  • question.answers.first.answer_sample: A tiny piece of the question text, 90 first chars;
  • question.answers.first.question: The question name;
  • question.answers.first.updated_at: The complete date of the most recent update (hour included);
  • question.answers.first.created_at: The complete date of creation (hour included);
  • question.answers.first.body: Retrieve a Long String with the text;

Was this article helpful?

Can't find what you're looking for?

Contact Support