Forum

Thread tagged as: Problem, Blog

Blog attributes

Hi guys

I notice there are no page attributes for blog posts, which means that our global header doesn't work. Two questions:

  1. How can we add meta data to posts? (Do we need to create custom fields? That would mean the user manages SEO data in two different ways: attributes for pages, content fields for posts...)
  2. How can we add meta data to listing pages like the blog home page? I assume this will need to be hardcoded into the templates?
  3. How can we add content fields to listing pages like the blog home page? For example we need to add a header image and some text.
  4. How can we rename Blog to something else, such as News?
Russell Back

Russell Back 2 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I notice there are no page attributes for blog posts, which means that our global header doesn't work. Two questions:

Blog posts don't have page attributes because they're not pages. They're a type of content that can be displayed on a page. Pages can contain all sorts of mixes of types of content, such is the flexibility.

  1. How can we add meta data to posts? (Do we need to create custom fields? That would mean the user manages SEO data in two different ways: attributes for pages, content fields for posts...)

Add fields to the post.html template to capture whatever content you need alongside the blog post.

Personally, I'm not sure I'd encourage a client to think about 'SEO data'. I'd add fields to describe the content. The way the content ends up being used doesn't matter to the person writing a blog post.

  1. How can we add meta data to listing pages like the blog home page? I assume this will need to be hardcoded into the templates?

How is your blog set up, and what do you need to add? A blog home page would normally just be another page, and you could add perch_content() regions as normal.

If that doesn't fit your requirement, perhaps explain why and we can help.

  1. How can we add content fields to listing pages like the blog home page? For example we need to add a header image and some text.

Again, just regular perch_content() regions should do it. It's just a page.

  1. How can we rename Blog to something else, such as News?

Do you mean within the control panel? The best way to do that would be to 'translate' it using the language file.

Hi Drew

I notice there are no page attributes for blog posts, which means that our global header doesn't work. Two questions: Blog posts don't have page attributes because they're not pages.

They're a type of content that can be displayed on a page. Pages can contain all sorts of mixes of types of content, such is the flexibility.

I take your point but viewing a post on its own is pretty standard blog practice, and one that Perch adopts in that you have a post.html template. With that in mind it seems odd not to have the same notion of attributes so CMS users get the same admin experience.

How can we add meta data to posts? (Do we need to create custom fields? That would mean the user manages SEO data in two different ways: attributes for pages, content fields for posts...)

Add fields to the post.html template to capture whatever content you need alongside the blog post. Personally, I'm not sure I'd encourage a client to think about 'SEO data'. I'd add fields to describe the content. The way the content ends up being used doesn't matter to the person writing a blog post.

In that case why have meta data fields for SEO in page attributes and not as content fields? Again it seems strange to have two different approaches to pages and posts - both can be either displayed on their own or within other pages.

How can we rename Blog to something else, such as News?

Do you mean within the control panel? The best way to do that would be to 'translate' it using the language file.

In the control panel but also on the front end - Blog comes out in the front end menu generated by perch_pages_navigation().

Also one more, what happened to the email notification on the forum? In the old forum you could subscribe to a thread but I can't see that option in the new forum and I'm not getting any notifications of replies.

Thanks again.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Russell Back said: I take your point but viewing a post on its own is pretty standard blog practice, and one that Perch adopts in that you have a post.html template. With that in mind it seems odd not to have the same notion of attributes so CMS users get the same admin experience.

The post.html template is the master template of editing a blog post. The presentation of the posts is completely flexible - they don't need to be tied to a page. With the way Perch works it just doesn't make sense to have some sort of special page status for an item of content.

In that case why have meta data fields for SEO in page attributes and not as content fields? Again it seems strange to have two different approaches to pages and posts - both can be either displayed on their own or within other pages.

That's a common use, so that's what the example templates use. I'm not sure I'd expect anyone to use those any more than I'd expect them to use the example article.html template.

How can we rename Blog to something else, such as News? In the control panel but also on the front end - Blog comes out in the front end menu generated by perch_pages_navigation().

That's just down to how you name the pages you put the blog functions on. It's up to you completely.

Also one more, what happened to the email notification on the forum? In the old forum you could subscribe to a thread but I can't see that option in the new forum and I'm not getting any notifications of replies.

It's being worked on.

How can we rename Blog to something else, such as News? In the control panel but also on the front end - Blog comes out in the front end menu generated by perch_pages_navigation().

That's just down to how you name the pages you put the blog functions on. It's up to you completely.

I might be missing something here. I've renamed the Blog page to News and that's fine. However the URL to posts is still /blog:

<a href="<perch:blog id="postURL" />">Read more</a>

Outputs:

<a href="/blog/post.php?s=2014-06-23/im-the-first-sample-blog-post">Read more</a>

How can I change that so that the URLs are /news and also change the Blog label in the Apps menu of the CMS to News?

I think you’ll need to edit the "Blog post page path" in the settings page under blog, to something like this

/news/post.php?s={postSlug}

Nick Bramwell said:

I think you’ll need to edit the "Blog post page path" in the settings page under blog, to something like this

/news/post.php?s={postSlug}

Thanks, Nick; that worked.

Any idea how to change the app label in the backend?

Drew McLellan

Drew McLellan 2638 points
Perch Support

You can change it by treating it as a translation in the language file.

Thanks, Drew.