Dynamic page title for Blog archive

I have created a page and set it to display my latest posts. I am also creating a layout for the blog archive.

I have a section that I want to add the name of the page. If I do it using dynamic content {{dc:post:title}}, it returns the first blog post title instead of the name of the page.

Can I have the section return the name of the page instead? Or the option for blog title set in theme preferences? In this case “Notebook” or can I only place a headline element and hard code the title?

Hi @designerken,

Thanks for reaching out.
You can set the hoarcoded Title using the Headline element, also you can use the {{dc:global:site_title}} to get the site title or {{dc:archive:name}} to get the specific archive name while in category or tag or any other type of archive pages are shown.

Hope it helps.
Thanks

Hi @tristup

I don’t think you are understanding whatI am trying to do.

I have created a page called Notebook and in Settings > Reading I have set it to my posts page.

I have created a layout that it’s condition is set to Blog - is being viewed. In that layout design I have a section that contains a headline and a section that contains a 3 column layout pulling in the posts.

In the headline I am trying to dynamically pull in the Page title (Notebook in this case).

I have tried {{dc:archive:name}} and {{dc:post:title}} and neither will pull in the name (Notebook) on the front end. What I get instead is the Category Name or Title of the first blog post that is displayed on the page.

For all my other pages I have created this same headline section and used {{dc:post:title}} just fine (ie. About, Contact, FAQs). But for the Blog page I cannot get it to work.

So my question again is how do I dynamically display the Page title in the headline when viewing the Blog archive page?

Hello @designerken,

Once a page is assigned as your Posts Page, it is no longer a normal page. Thus, the {{dc:archive:name}} and {{dc:post:title}} will not work. It is best that you create another layout for your blog index and use a headline element with a static text content in it.

Hope this helps.

Hi @ruenel

Thanks, that is what I needed to know. Is your suggestion the “preferred” way of doing this? Or should I not have selected a Posts Page in the settings? If no page is selected, what happens when you use your dynamic content to point to a blog link?

Hello @designerken,

In case if you don’t set the “Post Page” from the Settings–>Reading then the " {{dc:global:blog_url}} " dynamic content code return the same page URL where you would use it. In case if you set the Post Page then the " {{dc:global:blog_url}} " dynamic content code returns the blog page URL.

Hope it helps
Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.