Hi.
I have several blogs in my portal. How can I change the “default” blog?
Background: I use `blog_recent_posts(‘default’, 200)` and `blog_by_id(‘default’)` and want the correct blog to appear.
Hi.
I have several blogs in my portal. How can I change the “default” blog?
Background: I use `blog_recent_posts(‘default’, 200)` and `blog_by_id(‘default’)` and want the correct blog to appear.
Hello @phlp
You can change the default blog. Follow the path
Setting --> Website --> Blog --> (Current view:) Select the blog you want to change.
After next step is
Click to the Templates --> Blog Listing Page --> Actions --> change the template
=> Screenshot attach
I hope it helps you.
I think you missunderstood me.
I don’t want to change the template. I want to change the default blog when calling `blog_by_id(‘default’)`
Hi @phlp,
You can’t change which blog is “default” globally, but you can add a Blog field to a custom module so editors pick a blog per page/module instance. See Blog field.
But: if you’re using those functions in a custom module you could add a blog function to your module like this
and write the code like this
{% set rec_posts = blog_recent_posts(module.blog, 200) %} {# without quotes! #} Please note blog_recent_posts has a limit: 200 posts max and 10 calls per page/email.
this will give you the option to select the blog individually per page/module instance.
Or you could replace “default” with the blog ID which can be found in the URL while you’re in the HubSpot settings selecting the different blogs.
The URL structure:
https://app.hubspot.com/settings/YOUR-Hub-ID/website/blogs/BLOG-ID/default
Hope this helps
best,
Anton
Moderator note: While this solution may not address the original poster’s specific situation, it could be helpful for other community members facing similar challenges.
Unfortunately this answer does not address the question, which is the same one I have. We have two blogs - one for industry news and one for company news. We most often create posts for the industry blog so that is the one we would like to have as the default when we create a new post. However, right now, the default is the company news blog. So we have inadvertently published industry posts on the company news blog when they should have been posted to the industry blog. Is there a way to change the default blog so when we create a new post, it is for the industry blog, not news?