Shopify/Liquid Variables and Objects Reference
Helpjuice uses a programming language Object Oriented to fetch database results, heres a list of all the objects and variables:
- 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;
- account: Object that returns a list of properties related to the KB account;
- internal_kb_user: Object that contains the info on the logged in user;
- current_user:Same as internal_kb_user ;
- javascript_includes: This Object is specific for the template it returns a string containing the main JS;
- responsivemenu_js: This Object is specific for the template it returns a string containing the javascript files responsible for the mobile menu;
- typewatch_js: This Object is specific for the template 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 it returns a string containing the javascript files responsible for the fetching and displaying of questions after performing a search;
- content_for_layout: This Object fetches the contents on the current page as a text and paste it over the template code
- 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.
Some of those objects and variables have attributes:
Question
- .name : Retrieve a String with the full name of the question;
- .answers : Retrieve a Long String with the text;
-
.category : Fetch the parent category to the specific question and returns as a object ;
- .id : Identification number of said question;
- .url : URL Slug text starting imidiately after the domain;
-
.votes : Sum quantity of feedback votes;
- .feedback_url: used in the feedback form, more details here;
- .positive_votes : positive votes quantity only;
- .negative_votes : negative votes quantity only;
- .answer_sample : A tiny piece of the question text, 90 first chars;
- .long_answer_sample : A small piece of the question text, 350 first chars;
- .related_questions : Returns a list of question objects with similar location;
-
.published_date : The complete date of publication (hour included);
- .last_updated : The complete date of the most recent update (hour included);
-
.is_internal : Boolean value returns true if the question is indeed internal;
-
.author_first_name : The autors first name;
- .author_last_name : The autors last name;
- .tags_name : A list with the tags for the question;
Category
- .name : Retrieve a String with the full name of the question;
- .show_all_questions_link : URL Slug text starting imidiately after the domain;
- .category_link : A anchor tag with name and href to the category;
- .url : URL Slug text starting imidiately after the domain;
- .all_self_and_descendants: List of category objects with children and the current category it self;
- .descendants : List of category objects containing all the children and beyond categories;
- .children : List of category objects containing all the children and beyond categories;
- .root : Return a single object parent to the current category;
- .id: Identification number of said category;
- .parent: Return a single object parent to the current category;
-
.published_questions_by_id : returns the questions object ordered by ID;
- .is_internal? :Boolean value returns true if the question is indeed internal;
-
.number_of_questions : quantity of questions inside this category, subcategories not included, can be replaced by {{category.questions.size}};
-
.published_questions : List of published questions in this category, subcategories not included;
-
.questions : List of all questions in this category, subcategories not included;
- .has_children? : Boolean value, assumes true if the current category have subcategories.