Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello everyone,
I'm creating a new "featured articles" section for a client where they can select one or more specific articles to showcase. The design is really quite simple but I'm having a hard time figuring out how to get the name of the associated/parent blog from the article object. It doesn't appear to be available in the documentation and my searching hasn't yielded any useful results.
There was one suggestion to grab the blog names from the article handles, but that won't work in this case as the blog names have special characters in them that are stripped out for URLs.
This information is surely available somewhere though, right? Pretty much everything else from an article is made available so the associated blog should be as well.
Solved! Go to the solution
This is an accepted solution.
@Trudy it turns out that the blog object is implicitly available on the article template. I didn't really see this documented anywhere originally but realized it after Googling around for a while.
So, in other words, you don't really have to do anything special. Simply use {{ blog.title }}.
Hello there,
please check this article
https://shopify.dev/api/liquid/objects/article
Uh, thanks? Do you care to expand on that comment? You didn't really answer anything. I clearly know what the article object is, and was looking for specific advice.
Ok...this is kind of hacky, but I'm trying to do the same thing and you could use the template_suffix property. Create an article template for each blog type (even if they're identical), then use the template_suffix to know which blog each article is from.
🙂
This is an accepted solution.
@Trudy it turns out that the blog object is implicitly available on the article template. I didn't really see this documented anywhere originally but realized it after Googling around for a while.
So, in other words, you don't really have to do anything special. Simply use {{ blog.title }}.
Oh thanks!! That's really good to know!
I realize this post is a little older -- but in my case the client is able to choose articles to be displayed around the site and we needed to determine which blog it came from. So the global blog object did not work. Instead I wrote the following code to scrape the handle from the referenced article's url and get it from there.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025