Create a separate template for Hubspot Blog Listing page when on page 2 - blogs

I have a Hubspot blog listing template with a hero image, featured blog posts, content listing etc. When I click through to the second page of listings, I would like a template where it doesn't display the hero image or featured posts, it just displays the listings. Is this possible to do within Hubspot?
Thanks,

Use HubL in your template and look at the HTTP request page variables, namely the request.path. If you know the path of the blog listing page, just use an if statement to only show what you want when the request.path matches that exact page.
{% if request.path == '/path/to/listing/page' %}
{# HERO CODE HERE #}
{% endif %}
The answer I guess is, yes. But it will require some custom templating. I'm sure you could also use Javascript but that is a bit less elegant.

Related

Shopify: How to reuse components inside sections?

how are you?
I have a problem with a page I am trying to create for my store. It's a page with a headline plus 9 images, that could be easily achieved with a section (title + blocks) but this headline + photos (lets call it gallery) appears three times on my page.
How to repeat the same section, different data on the same page? So far I have the template layout for my page, I know how to add sections and snippets, the issue is how to reuse that gallery section containing title + photos.
For example, I could do this on my page layout:
{% section 'page-street-template' %}
{% section 'page-street-template2' %}
{% section 'page-street-template3' %}
But that's quite ugly and I will need to repeat everything three times.
Thanks
]1
Sections are not repeatable outside the index page.
You can call the same section multiply times, but the data will be the same. Once you change a section data this will be applied for each page you use this section for.
If you like to use repeatable data and you don't rely on the blocks for the section at the moment, you can use blocks, since they are repeatable and you can have different data.
If you are using blocks you can create a more complex logic where you will have a different type of block for your heading and a separate one for your image, then you will need to split your content in order to achieve the above layout you provided.
That said if you use the section on a different page the blocks data will be applied to it as well.
So you can't use sections on multiply pages with different content. The content shared between all pages (except the homepage if the section is designated to be used there as well).
If you like to have a different dynamic content for different pages the best approach will be to use an Metafields APP.
Other than that you can use other approaches that will require more coding like:
prefixed page, where you prefix pages and called using pages[handle] to get their content
navigations, where you can create a navigation with the same name as the page and based on the links call each page link in linklists[page.handle].links => link.object.content
TLDR; no you can't reuse the same section on the page with different data, but you can go around this limitation.

add sku to many page in shopify

I need to add the SKU in 2000 pages in a website of shopify. I know that you can use the html code to do it, however, I did not mention it, if you could help me, I would appreciate it.
This is the way it should be:
This is the data that should be called:
Add {{ current_variant.sku }} to your liquid file (probably product-template.liquid) in the place you want it to show up.

How to check if it's a HomePage/Frontpage?

In BOLT CMS how do I check if the current page is a homepage?
I need to check on _footer.twig file that if it's homepage then make the footer sticky.
Sorry if i sound blunt but I searched on the internet and on the default templates but didn't find a clue.
In the template? From the Bolt 3.0 cheatsheet, you can check to see if {{ app.request.get('_route') }} is the same route as the homepage.

jekyll "back" button from blog post

I have a blog/index.html file with a list of blog posts and excerpts. once i click on a blog post, it opens up in a new page in its entirety.
I would like to place a "back" button at the end of each post that should go back at the last page you visited.
is there a liquid tag to achieve this?
Unfortunately there is no liquid tag that you can use. However, you have a choice of placing a link with static destination link like this:
Back
Or you can use javascript to take user to the previously visited page
<a onclick="window.history.back()">Back</a>
If you want to go back to the site root (edit, thanks coatless). This works.
With markdown:
[Back]({{ site.url }}/)
With HTML:
<a href='{{site.url}}/'>Back</a>
Also check out: https://jekyllrb.com/docs/pagination/

dropdown menu inside iframe

I have a bit of a problem. I made a blog for my webpage, and I use the header of it in my blog.
The thing is, I have a drop down menu which includes a pretty long menu, so when used in the blog, the iframe does not show all of it, only the first few options.
I'm wondering whether there is a way to make that iframe extends or allow the menu to show the options.
I think that you should include the header server side instead of embedding it using an iframe. How you do this depends on what platform you're using.
If you are using plain html, the simplest option is to just copy the header. If you are using IIS you could extract the header to its own file and include it using SSI:
<!--#include file="header.html"-->
If you're using some kind of templating system, perhaps you could extract the header so that it exists in its own template file and then include it where needed. Using Django:
{% include "header.html" %}
If you have a homebrew site, perhaps you are using PHP? Then you could just include it like this, of course:
<?php include('header.html'); ?>