TYPO3 blog posts in one page

2019-06-01 05:09发布

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):

  • Post Title
  • Post Date
  • Full Post Content
  • Post Author

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!

2条回答
够拽才男人
2楼-- · 2019-06-01 05:17

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

查看更多
三岁会撩人
3楼-- · 2019-06-01 05:31

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.
查看更多
登录 后发表回答