Skip to content

Commit df1cd9d

Browse files
authored
[FEATURE] Add blog posts to link browser (#169)
1 parent fbd2de5 commit df1cd9d

File tree

5 files changed

+36
-1
lines changed

5 files changed

+36
-1
lines changed

Configuration/Sets/BlogExample/settings.definitions.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,17 @@ settings:
3333
description: 'Path to layout root'
3434
type: string
3535
default: 'EXT:blog_example/Resources/Private/Layouts/'
36+
blogExample.singlePid:
37+
label: 'Single view for blog posts'
38+
category: BlogExample.pages
39+
description: 'Page to display single blog entries'
40+
type: page
41+
default: 0
3642
blogExample.storagePid:
3743
label: 'Default storage PID'
3844
category: BlogExample.pages
3945
description: 'Folder that stores all blogs, blog-posts and comments'
40-
type: int
46+
type: page
4147
default: 0
4248
blogExample.editorUsergroupUid:
4349
label: 'Frontend admin user group UID'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: t3docs/blog-example-links
2+
label: Link browser for blog posts
3+
dependencies:
4+
- t3docs/blog-example
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
TCEMAIN.linkHandler {
2+
blogExample {
3+
handler = TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler
4+
label = LLL:blog_example.module.mod:linkbrowser
5+
configuration {
6+
table = tx_blogexample_domain_model_post
7+
pageTreeMountPoints = {$blogExample.storagePid}
8+
}
9+
displayAfter = url
10+
scanBefore = page
11+
}
12+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
config.recordLinks.blogExample {
2+
// Do not force link generation when the record is hidden
3+
forceLink = 0
4+
5+
typolink {
6+
parameter = {$blogExample.singlePid}
7+
additionalParams.data = field:uid
8+
additionalParams.wrap = &tx_blogexample_bloglist[action]=show&tx_blogexample_bloglist[controller]=Post&tx_blogexample_bloglist[post]=|
9+
}
10+
}

Resources/Private/Language/Module/locallang_mod.xlf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
<trans-unit id="create_example_data">
2222
<source>Create example data</source>
2323
</trans-unit>
24+
<trans-unit id="linkbrowser">
25+
<source>Blog Post</source>
26+
</trans-unit>
2427
</body>
2528
</file>
2629
</xliff>

0 commit comments

Comments
 (0)