How to find undocumented HubL functions
Posted: Sun Feb 16, 2025 10:58 am
table of contents
1.Private Function Example
2.How to check for private functions
3.Conclusion
Private Function Example
First, let's look at the HubL functions on the official website . There are a fair number of functions available, including those that can operate on arrays and associative arrays ( dictionaries ). For example, there is a function that
can add a single item to the end of an array .append
{% set numbers = [0,1,2] %}
{% do numbers.append(3) %}
{{ numbers }}
HTML + HubL
The result [0,1,2,3]is: In fact, there is a
private function that can perform the same processing as this function .add
{% set numbers = [0,1,2] %}
{% do numbers.add(3) %}
{{ numbers }}
HTML + HubL
The result [0,1,2,3]will be the same.
In addition, the add function can be used in other ways by increasing the number of arguments.
{% set numbers = [0,1,2] %}
{% do numbers.add(0, 3) %}
{{ numbers }}
HTML + HubL
The processing is "add 3 to the 0th position", so the result is . This behavior is the same as the [3,0,1,2]official function.insert
This is just a guess, but I think that the add function has two different behaviors and is confusing, so append and insert were created.
Just to be clear, we are not recommending the use of the add function, so let's use the easier to understand append and insert!
Now onto the main topic: " How do we check india number data private functions? "
How to check for private functions
For non-public functions, HubSpot has published source code for developers and has documentation (javadoc) , so you can look it up from this material, but it will take time if you do it haphazardly.
However, if you know a little about programming, you can investigate it smoothly.
HubL is familiar to HubSpot template creators, but do you know what it's made of? HubL is a language that extends the Jinja-based template engine called "Jinjava," and as the name suggests, it's built on Java.
Those of you who have used Java may have guessed this, but the key to the investigation is the class name . If you know the class name, you can easily investigate it from the documentation or source. Of course, you don't need to know anything about Java, and it's easy to understand if you think of the class name as the file name .
So, to find the class name in HubL, pprintuse the filter pprint. pprint is a filter that displays the details of the data on the screen. Let's try pprinting an array as an example.
{{ [0,1,2]|pprint }}
HTML + HubL
The result (SizeLimitingPyList: [0, 1, 2])is displayed as, and SizeLimitingPyList is the class name .
Next, search for SizeLimitingPyList in the source and check its contents.
1.Private Function Example
2.How to check for private functions
3.Conclusion
Private Function Example
First, let's look at the HubL functions on the official website . There are a fair number of functions available, including those that can operate on arrays and associative arrays ( dictionaries ). For example, there is a function that
can add a single item to the end of an array .append
{% set numbers = [0,1,2] %}
{% do numbers.append(3) %}
{{ numbers }}
HTML + HubL
The result [0,1,2,3]is: In fact, there is a
private function that can perform the same processing as this function .add
{% set numbers = [0,1,2] %}
{% do numbers.add(3) %}
{{ numbers }}
HTML + HubL
The result [0,1,2,3]will be the same.
In addition, the add function can be used in other ways by increasing the number of arguments.
{% set numbers = [0,1,2] %}
{% do numbers.add(0, 3) %}
{{ numbers }}
HTML + HubL
The processing is "add 3 to the 0th position", so the result is . This behavior is the same as the [3,0,1,2]official function.insert
This is just a guess, but I think that the add function has two different behaviors and is confusing, so append and insert were created.
Just to be clear, we are not recommending the use of the add function, so let's use the easier to understand append and insert!
Now onto the main topic: " How do we check india number data private functions? "
How to check for private functions
For non-public functions, HubSpot has published source code for developers and has documentation (javadoc) , so you can look it up from this material, but it will take time if you do it haphazardly.
However, if you know a little about programming, you can investigate it smoothly.
HubL is familiar to HubSpot template creators, but do you know what it's made of? HubL is a language that extends the Jinja-based template engine called "Jinjava," and as the name suggests, it's built on Java.
Those of you who have used Java may have guessed this, but the key to the investigation is the class name . If you know the class name, you can easily investigate it from the documentation or source. Of course, you don't need to know anything about Java, and it's easy to understand if you think of the class name as the file name .
So, to find the class name in HubL, pprintuse the filter pprint. pprint is a filter that displays the details of the data on the screen. Let's try pprinting an array as an example.
{{ [0,1,2]|pprint }}
HTML + HubL
The result (SizeLimitingPyList: [0, 1, 2])is displayed as, and SizeLimitingPyList is the class name .
Next, search for SizeLimitingPyList in the source and check its contents.