Skip to content
Snippets Groups Projects
README.md 2.05 KiB
Newer Older
Stefan Galinski's avatar
Stefan Galinski committed

sg_news will not be an install & forget extension as we needs some rendering information for the frontend. This
means you need to provide some information how the extension needs to integrated into your template. As the
extension itself provides two new doktypes, we can simply add a switch case to our typoscript fluid template
to provide different rendering paths. Please look at the example below:
Stefan Galinski's avatar
Stefan Galinski committed

```
lib.pageTemplate.default = FLUIDTEMPLATE
lib.pageTemplate.default {
	file = EXT:project_theme/Resources/Private/Templates/Default.html
Stefan Galinski's avatar
Stefan Galinski committed

	variables {
		INTRO = CASE
		INTRO {
			key.field = doktype

			# show nothing for the intro view as sg_news provides it's own default intro section
			116 = TEXT
			116.value =

			# just show the content
			default < styles.content.col0
		}

		CONTENT = CASE
Stefan Galinski's avatar
Stefan Galinski committed
		CONTENT {
			key.field = doktype

			# show the single view of a news article if the page type matches
			116 < tt_content.list.20.sgnews_singleview

			# show the category view of the news if the page type matches
			117 < tt_content.list.20.sgnews_listbycategory

			# just show the content
			default < styles.content.col1
Stefan Galinski's avatar
Stefan Galinski committed
		}
	}
}
```

In this example we will load by default the first column for the intro section and the second column in the backend
for the content below that. The news category (doktype 117) will render by default not the content on the page alone,
but also the default category listing. The related extension plugin knows itself how to render on such a page. The
news page itself also get's some special rendering information here. In our case we don't want the intro section
rendered and also not the default content as the extension itself handles the special content rendering for it's
special case by referencing the singleview extension plugin of sg_news.

The single news plugin also needs some additional knowledge from there it can get the base content. Please provide
in your typoscript the information of lib.mainContent. By default it will resolve to the following code if not
provided by you:

```
lib.mainContent < styles.content.col1
```