LuisBento
LuisBento

Reputation: 716

TYPO3 blog posts in one page

I am quite new to TYPO3 and i am trying to build something which i am not sure how to do!

I have installed the T3G/blog extension. On my website i have a "Blog" page, where i would like to show the blog posts like this (for each post):

I imagine i have to use a for loop to go through the blog posts available, but i can't find a way to make it work.

Right now i have something like this:

<div class="blog__content__left">
   <f:debug>{_all}</f:debug>

   <div class="blog__post__title"></div>
   <div class="blog__post__date"></div>
   <div class="blog__post__content"></div>
   <div class="blog__post__author"></div>

</div> 

The output of the debug is an array with my posts, but now my question is:

how can i render the right information on the right place?

Thank you!

Upvotes: 1

Views: 148

Answers (2)

Heinz Schilling
Heinz Schilling

Reputation: 2262

You have to loop through all posts of a blog.

<f:for each="{blog.posts}" as="post">
    <h2>{post.title}</h2>
    <p>{post.content}</p>
</f:for>

There are so many tutorials about blog. Have a look at https://docs.typo3.org/typo3cms/ExtbaseFluidBook/3-BlogExample/Index.html

Upvotes: 2

Scopestyle
Scopestyle

Reputation: 665

Debug

When you see the output in your debug, you can use the information in your template. Say your debug output sais the following:

 - Blog
  > Headline
  > Text 

You can call these items in your template as {blog.headline} (for example).

Using original files as base for your own template

  • I suggest taking a look at the default templates provided. You can find these template in your typo3/typo3conf/ext/{extension}/Resources/Private Folder.
  • Take a look at the tags being used! You can use these in your template.
  • You should download the Layouts, Partials and Template folder, and upload these in your fileadmin/{blogmodule}/ folder. Set the path in TypoScript, You'll probably find an example in the plugin documentation.

Upvotes: 1

Related Questions