I am trying to create a blog listing that has both a title and a subtitle. As far as I can see, the content object of the blog post has a title and a post body, author information, tags. Is there a way to add more fields that can then be accessed when iterating through the contents in the blog listing page as well? Also, is there any documentation that details all of the properties that are available in the content object?
My personal approach is always to create custom module and drop it in the template. If the user should not use it disable it for further useage - it will still work in the places you’re implementing it
important note: You can’t use modules inside modules
- - -
a basic custom listing module could look something like this
But you don’t rely on the build-in loop “for content in contents” if you want more options or have a specific usecase you can use functions like blog_recent_posts to create your own custom listing. The module would look something like this:
Hi, I’m sorry if my question wasn’t clear. I know how to add custom modules to a template. My question is that I want to access a property of my custom blog post module, in my custom blog listing module. So that if I want to display something in my blog listing other than the featured image, name, post body, and absolute url, I should be able to do that. For instance, another piece of text, such as a subtitle, or a second image. Can I enable the user to set another property on the blog post, and then access that property on the blog listing?