Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sg_news
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TYPO3
sg_news
Commits
a95c45c5
Commit
a95c45c5
authored
8 years ago
by
Stefan Galinski
Browse files
Options
Downloads
Patches
Plain Diff
[TASK] Improve the documentation how to integrate the plugin into your theme
parent
37f15054
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+47
-22
47 additions, 22 deletions
README.md
with
47 additions
and
22 deletions
README.md
+
47
−
22
View file @
a95c45c5
## In
stall
ation
## In
tegr
ation
The following typoscript or something equivalent must be added to your site for the pages below the overview page.
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:
```
# used in the single view template to render the news content
lib.mainContent < styles.content.col0
lib.pageTemplate.default = FLUIDTEMPLATE
lib.pageTemplate.default {
file = EXT:project_theme/Resources/Private/Templates/Default.html
lib.pageTemplate {
variables {
CONTENT = COA
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
CONTENT {
# load the plugin instead of any page template content on news pages
10 = COA
10 {
10 < tt_content.list.20.sgnews_singleview
if.value.field = doktype
if.equals = 116
}
# load the overview plugin on category pages
20 = COA
20 {
10 < tt_content.list.20.sgnews_overview
if.value.field = doktype
if.equals = 117
}
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
}
}
}
```
\ No newline at end of file
```
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
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment