Skip to content

Instantly share code, notes, and snippets.

View apsolut's full-sized avatar
🎯
Focusing

Aleksandar Perisic apsolut

🎯
Focusing
View GitHub Profile
<div class="post-listing">
{% set post_ids = [] %}
{% for post_item in module.posts %}
{% do post_ids.append(post_item.post_id) %}
{% endfor %}
{% if post_ids %}
<div class="post-listing">
{% for post_id in post_ids %}
{% set pageContents = content_by_ids([post_id]) %}
<div class="post-listing">
{% set post_ids = [] %}
{% for post_item in module.posts %}
{% do post_ids.append(post_item.post_id) %}
{% endfor %}
{% set contents = content_by_ids(post_ids) %}
{% for content in contents %}
<div class="post-item">
@apsolut
apsolut / list-posts-on-page.hubl
Last active October 1, 2024 18:03
HubSpot get posts on page - landing page
<div class="post-showcase">
{% set post_ids = [] %}
{% for post_item in module.posts %}
{% do post_ids.append(post_item.post_id) %}
{% endfor %}
{% set contents = content_by_ids(post_ids) %}
{% for content in contents %}
<div class="post-item">
<div class="featured-posts-container">
{% set featured_posts = blog_recent_topic_posts('default', 'featured', 3) %}
{% for topic_post in featured_posts %}
<a href="{{ topic_post.absolute_url }}" class="featured-post">
<div class="topic-post " style="padding: 10px;">
<div class="topic-text">
<p>{{ content.tag_list }}</p>
<h2>{{ topic_post.name }}</h2>
@apsolut
apsolut / hubspot-youtube-get-ID-macro.html
Last active September 4, 2024 17:31
hubspot youtube get ID
{# Function to extract YouTube video ID #}
{% macro extract_youtube_id(url) %}
{% set cleaned_url = url|trim %}
{% set video_id = cleaned_url
| replace("https://www.youtube.com/watch?v=", "")
| replace("http://www.youtube.com/watch?v=", "")
| replace("https://youtu.be/", "")
| replace("http://youtu.be/", "")
| split("&")
| first
{# add macro for video schema.org #}
{% import '../../macros/video-schemaorg.html' as video_macros %}
{{ video_macros.video_schema(module.options_video) }}
@apsolut
apsolut / hubspot-scope-css.html
Last active September 4, 2024 17:33
HubSpot Scope CSS
{% require_css %}
<style>
{% scope_css %}
{% end_scope_css %}
</style>
{% end_require_css %}
@apsolut
apsolut / n8n.js
Created November 25, 2023 01:18
n8n
// repolace
{{ $json["jobs"]["location"]["workplace_type"].replace('on_site', 'onsite') }}
@apsolut
apsolut / hs-on-form-submit.js
Created September 28, 2023 08:43
HS onform submitt
$('.hs_cos_wrapper_type_form').on('hsvalidatedsubmit', '.hs-form', function (e) {
console.log( 'check check' );
});
window.addEventListener('message', function (event) {
if (event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmit') {
/* print to the console on submit, or add in custom redirect in here */
console.log('onFormSubmit');
}
});