├── Configuration ├── Sets │ ├── BlogExample │ │ ├── config.yaml │ │ ├── setup.typoscript │ │ └── settings.definitions.yaml │ ├── RssFeed │ │ ├── config.yaml │ │ ├── constants.typoscript │ │ ├── settings.definitions.yaml │ │ └── setup.typoscript │ ├── BlogLinks │ │ ├── config.yaml │ │ ├── page.tsconfig │ │ └── setup.typoscript │ └── DefaultStyles │ │ ├── config.yaml │ │ └── setup.typoscript ├── page.tsconfig ├── ExpressionLanguage.php ├── Services.yaml ├── TCA │ ├── Overrides │ │ ├── fe_users.php │ │ └── tt_content.php │ ├── tx_blogexample_domain_model_info.php │ ├── tx_blogexample_domain_model_comment.php │ ├── tx_blogexample_domain_model_tag.php │ ├── tx_blogexample_domain_model_person.php │ ├── tx_blogexample_domain_model_blog.php │ └── tx_blogexample_domain_model_post.php ├── FlexForms │ └── PluginSettings.xml ├── Backend │ └── Modules.php ├── Extbase │ └── Persistence │ │ └── Classes.php └── Icons.php ├── Resources ├── Public │ ├── Icons │ │ ├── icon_new.gif │ │ ├── icon_close.gif │ │ ├── icon_edit.gif │ │ ├── icon_next.gif │ │ ├── icon_delete.gif │ │ ├── icon_populate.gif │ │ ├── icon_previous.gif │ │ ├── icon_relation.gif │ │ ├── icon_plaintext.gif │ │ ├── FlashMessages │ │ │ ├── ok.png │ │ │ ├── error.png │ │ │ ├── notice.png │ │ │ ├── warning.png │ │ │ └── information.png │ │ ├── default_gravatar.gif │ │ ├── icon_tx_blogexample_domain_model_blog.gif │ │ ├── icon_tx_blogexample_domain_model_post.gif │ │ ├── icon_tx_blogexample_domain_model_tag.gif │ │ ├── icon_tx_blogexample_domain_model_comment.gif │ │ ├── icon_tx_blogexample_domain_model_person.gif │ │ ├── Extension.svg │ │ └── module-blog.svg │ └── Css │ │ └── BlogExample.css └── Private │ ├── Layouts │ └── Default.html │ ├── Partials │ ├── PostMetaData.html │ ├── PostTags.html │ ├── BlogForm.html │ ├── FormErrors.html │ ├── CommentForm.html │ ├── PostForm.html │ └── Pagination.html │ ├── Templates │ ├── Post │ │ ├── Index.txt │ │ ├── New.html │ │ ├── Edit.html │ │ ├── DisplayRssList.html │ │ ├── Show.html │ │ └── Index.html │ └── Blog │ │ ├── New.html │ │ ├── Edit.html │ │ └── Index.html │ ├── Language │ ├── plugin.xlf │ ├── Module │ │ └── locallang_mod.xlf │ ├── locallang_db.xlf │ └── locallang.xlf │ └── Backend │ └── Templates │ ├── ShowBlog.html │ ├── ShowAllComments.html │ ├── ShowPost.html │ └── Index.html ├── ext_conf_template.txt ├── ext_tables.sql ├── ext_emconf.php ├── Classes ├── Exception │ └── NoBlogAdminAccessException.php ├── Domain │ ├── Model │ │ ├── Administrator.php │ │ ├── Tag.php │ │ ├── Info.php │ │ ├── FrontendUser.php │ │ ├── Comment.php │ │ ├── FrontendUserGroup.php │ │ ├── Person.php │ │ ├── Blog.php │ │ └── Post.php │ ├── Repository │ │ ├── AdministratorRepository.php │ │ ├── PersonRepository.php │ │ ├── BlogRepository.php │ │ ├── CommentRepository.php │ │ └── PostRepository.php │ └── Validator │ │ ├── TitleValidator.php │ │ ├── PostValidator.php │ │ └── BlogValidator.php ├── PageTitle │ └── BlogPageTitleProvider.php ├── Service │ ├── PostValidationService.php │ ├── BlogValidationService.php │ └── BlogFactory.php ├── ExpressionLanguage │ └── ExtensionConfigurationProvider.php ├── Upgrades │ ├── PluginUpgradeWizard.php │ └── MigratePluginsToContentElementsUpgradeWizard.php ├── Property │ └── TypeConverters │ │ └── HiddenCommentConverter.php ├── ViewHelpers │ └── GravatarViewHelper.php └── Controller │ ├── CommentController.php │ ├── BlogController.php │ └── PostController.php ├── CHANGELOG.md ├── Makefile ├── CONTRIBUTING.md ├── ext_localconf.php ├── composer.json └── README.md /Configuration/Sets/BlogExample/config.yaml: -------------------------------------------------------------------------------- 1 | name: t3docs/blog-example 2 | label: Blog example set 3 | -------------------------------------------------------------------------------- /Configuration/page.tsconfig: -------------------------------------------------------------------------------- 1 | templates.t3docs/blog-example.100 = t3docs/blog-example:Resources/Private/Backend/ 2 | -------------------------------------------------------------------------------- /Resources/Public/Icons/icon_new.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/icon_new.gif -------------------------------------------------------------------------------- /Resources/Public/Icons/icon_close.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/icon_close.gif -------------------------------------------------------------------------------- /Resources/Public/Icons/icon_edit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/icon_edit.gif -------------------------------------------------------------------------------- /Resources/Public/Icons/icon_next.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/icon_next.gif -------------------------------------------------------------------------------- /Resources/Public/Icons/icon_delete.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/icon_delete.gif -------------------------------------------------------------------------------- /Resources/Public/Icons/icon_populate.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/icon_populate.gif -------------------------------------------------------------------------------- /Resources/Public/Icons/icon_previous.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/icon_previous.gif -------------------------------------------------------------------------------- /Resources/Public/Icons/icon_relation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/icon_relation.gif -------------------------------------------------------------------------------- /Configuration/Sets/RssFeed/config.yaml: -------------------------------------------------------------------------------- 1 | name: t3docs/blog-example-rss 2 | label: Blog example RSS feed 3 | dependencies: 4 | - t3docs/blog-example 5 | -------------------------------------------------------------------------------- /Resources/Public/Icons/icon_plaintext.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/icon_plaintext.gif -------------------------------------------------------------------------------- /Resources/Public/Icons/FlashMessages/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/FlashMessages/ok.png -------------------------------------------------------------------------------- /Resources/Public/Icons/default_gravatar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/default_gravatar.gif -------------------------------------------------------------------------------- /Configuration/Sets/BlogLinks/config.yaml: -------------------------------------------------------------------------------- 1 | name: t3docs/blog-example-links 2 | label: Link browser for blog posts 3 | dependencies: 4 | - t3docs/blog-example 5 | -------------------------------------------------------------------------------- /Resources/Public/Icons/FlashMessages/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/FlashMessages/error.png -------------------------------------------------------------------------------- /Resources/Public/Icons/FlashMessages/notice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/FlashMessages/notice.png -------------------------------------------------------------------------------- /Configuration/Sets/DefaultStyles/config.yaml: -------------------------------------------------------------------------------- 1 | name: t3docs/blog-example-styles 2 | label: Blog example default styles 3 | dependencies: 4 | - t3docs/blog-example 5 | -------------------------------------------------------------------------------- /Resources/Public/Icons/FlashMessages/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/FlashMessages/warning.png -------------------------------------------------------------------------------- /Resources/Public/Icons/FlashMessages/information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/FlashMessages/information.png -------------------------------------------------------------------------------- /Configuration/Sets/DefaultStyles/setup.typoscript: -------------------------------------------------------------------------------- 1 | # Include BlogExample default styles 2 | 3 | page.includeCSS.tx_blogexample = EXT:blog_example/Resources/Public/Css/BlogExample.css 4 | -------------------------------------------------------------------------------- /Resources/Public/Icons/icon_tx_blogexample_domain_model_blog.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/icon_tx_blogexample_domain_model_blog.gif -------------------------------------------------------------------------------- /Resources/Public/Icons/icon_tx_blogexample_domain_model_post.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/icon_tx_blogexample_domain_model_post.gif -------------------------------------------------------------------------------- /Resources/Public/Icons/icon_tx_blogexample_domain_model_tag.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/icon_tx_blogexample_domain_model_tag.gif -------------------------------------------------------------------------------- /Resources/Public/Icons/icon_tx_blogexample_domain_model_comment.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/icon_tx_blogexample_domain_model_comment.gif -------------------------------------------------------------------------------- /Resources/Public/Icons/icon_tx_blogexample_domain_model_person.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TYPO3-Documentation/blog_example/HEAD/Resources/Public/Icons/icon_tx_blogexample_domain_model_person.gif -------------------------------------------------------------------------------- /ext_conf_template.txt: -------------------------------------------------------------------------------- 1 | # cat=basic; type=string; label=Example entry: This is just an example for ExtensionConfigurationProvider to check, if this value is available in Expression Language 2 | foo = bar 3 | -------------------------------------------------------------------------------- /Configuration/Sets/RssFeed/constants.typoscript: -------------------------------------------------------------------------------- 1 | plugin.tx_blogexample { 2 | settings { 3 | # cat=plugin.tx_blogexample/a; type=int+; label=Rss page type:If the default RSS page typenum (778) conflicts with your setup, you can override this setting here 4 | rssPageType = 778 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Configuration/ExpressionLanguage.php: -------------------------------------------------------------------------------- 1 | [ 11 | ExtensionConfigurationProvider::class, 12 | ], 13 | ]; 14 | -------------------------------------------------------------------------------- /Resources/Private/Layouts/Default.html: -------------------------------------------------------------------------------- 1 | 3 | 4 |
5 | 6 | 7 |
8 |
9 |
10 | 11 |
12 | 13 | -------------------------------------------------------------------------------- /ext_tables.sql: -------------------------------------------------------------------------------- 1 | # 2 | # Table structure for table 'tx_blogexample_domain_model_tag_mm' 3 | # @TODO fix tx_blogexample_domain_model_person to create and recognize this mm-table 4 | # with the field `fieldname` automatically, remove this entry 5 | # @see https://forge.typo3.org/issues/98322 6 | # 7 | CREATE TABLE `tx_blogexample_domain_model_tag_mm` ( 8 | `fieldname` varchar(63) DEFAULT '' NOT NULL 9 | ); 10 | -------------------------------------------------------------------------------- /Configuration/Sets/BlogLinks/page.tsconfig: -------------------------------------------------------------------------------- 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 | } 13 | -------------------------------------------------------------------------------- /Configuration/Sets/BlogLinks/setup.typoscript: -------------------------------------------------------------------------------- 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 | } 11 | -------------------------------------------------------------------------------- /Resources/Private/Partials/PostMetaData.html: -------------------------------------------------------------------------------- 1 | 3 | 4 |
5 | 6 | {post.date -> f:format.date(format: '{f:translate(key: \'culture.date.formatShort\')}')} 7 | 8 | {post.author.fullName} 9 |
10 | 11 | -------------------------------------------------------------------------------- /Configuration/Services.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | _defaults: 3 | autowire: true 4 | autoconfigure: true 5 | public: false 6 | 7 | T3docs\BlogExample\: 8 | resource: '../Classes/*' 9 | exclude: '../Classes/Domain/Model/*' 10 | T3docs\BlogExample\Property\TypeConverters\HiddenCommentConverter: 11 | tags: 12 | - name: extbase.type_converter 13 | priority: 2 14 | target: T3docs\BlogExample\Domain\Model\Comment 15 | sources: int,string 16 | -------------------------------------------------------------------------------- /Resources/Private/Partials/PostTags.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Configuration/TCA/Overrides/fe_users.php: -------------------------------------------------------------------------------- 1 | 'LLL:blog_example.db:fe_users.tx_extbase_type.administrator', 13 | 'value' => Administrator::class, 14 | ]; 15 | } 16 | -------------------------------------------------------------------------------- /Configuration/Sets/RssFeed/settings.definitions.yaml: -------------------------------------------------------------------------------- 1 | categories: 2 | BlogExample.rss: 3 | label: 'RSS feed' 4 | parent: BlogExample 5 | 6 | settings: 7 | blogExampleRss.page_type: 8 | label: 'RSS page type' 9 | category: BlogExample.rss 10 | description: 'If the default RSS page type number (778) conflicts with your setup, you can override this setting here. ' 11 | type: int 12 | default: 778 13 | blogExampleRss.title: 14 | label: 'Title of the RSS feed' 15 | category: BlogExample.rss 16 | description: 'Path to template root' 17 | type: string 18 | default: 'The RSS feed' 19 | -------------------------------------------------------------------------------- /ext_emconf.php: -------------------------------------------------------------------------------- 1 | 'A Blog Example for the Extbase Framework', 5 | 'description' => 'This extension contains code examples used in TYPO3 explained to describe the use of Extbase', 6 | 'version' => '14.0.0', 7 | 'category' => 'example', 8 | 'author' => 'TYPO3 Documentation Team and contributors', 9 | 'author_company' => '', 10 | 'author_email' => '', 11 | 'state' => 'stable', 12 | 'constraints' => [ 13 | 'depends' => [ 14 | 'typo3' => '14.0.0-14.99.99', 15 | ], 16 | 'conflicts' => [], 17 | 'suggests' => [], 18 | ], 19 | ]; 20 | -------------------------------------------------------------------------------- /Resources/Private/Templates/Post/Index.txt: -------------------------------------------------------------------------------- 1 | {blog.title}: 2 | =============================================================== 3 | 4 | {post.title} 5 | --------------------------------------------------------------- 6 | {post.content} 7 | 8 | Published on {post.date -> f:format.date(format: '{f:translate(key: \'culture.date.formatShort\')}')} by {post.author.fullName} 9 | Tags: [{tag.name}] 10 | 11 | 12 | 13 | 14 | No Posts available. 15 | 16 | -------------------------------------------------------------------------------- /Classes/Exception/NoBlogAdminAccessException.php: -------------------------------------------------------------------------------- 1 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Resources/Private/Templates/Post/New.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | [cancel] 9 | 10 |

11 | [create post] 12 |

13 | 14 |
15 | 16 | -------------------------------------------------------------------------------- /Classes/Domain/Model/Administrator.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | LLL:blog_example.plugin:options 6 | array 7 | 8 | 9 | 10 | 11 | number 12 | 2 13 | 3 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Resources/Private/Templates/Post/Edit.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | [cancel] 9 | 10 |

11 | [edit post] 12 |

13 | 14 |
15 | 16 | -------------------------------------------------------------------------------- /Resources/Private/Templates/Blog/New.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | [cancel] 9 | 10 |

11 | [create blog] 12 |

13 |

14 | [create blog below] 15 |

16 | 17 |
18 | 19 | -------------------------------------------------------------------------------- /Resources/Private/Templates/Blog/Edit.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | [cancel] 9 | 10 |

11 | [edit blog] 12 |

13 |

14 | [edit blog below] 15 |

16 | 17 |
18 | 19 | -------------------------------------------------------------------------------- /Classes/Domain/Repository/AdministratorRepository.php: -------------------------------------------------------------------------------- 1 | 26 | */ 27 | class AdministratorRepository extends Repository {} 28 | -------------------------------------------------------------------------------- /Configuration/Backend/Modules.php: -------------------------------------------------------------------------------- 1 | [ 10 | 'parent' => 'web', 11 | 'position' => ['after' => 'web_info'], 12 | 'access' => 'user', 13 | 'workspaces' => 'live', 14 | 'path' => '/module/page/blog_example', 15 | 'labels' => 'LLL:EXT:blog_example/Resources/Private/Language/Module/locallang_mod.xlf', 16 | 'extensionName' => 'BlogExample', 17 | 'controllerActions' => [ 18 | BackendController::class => [ 19 | 'index', 20 | 'deleteAll', 21 | 'deleteBlog', 22 | 'populate', 23 | 'showBlog', 24 | 'showPost', 25 | 'showAllComments', 26 | ], 27 | ], 28 | ], 29 | ]; 30 | -------------------------------------------------------------------------------- /Classes/PageTitle/BlogPageTitleProvider.php: -------------------------------------------------------------------------------- 1 | title = $title; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Classes/Service/PostValidationService.php: -------------------------------------------------------------------------------- 1 | getTitle(), $this->forbiddenTitles); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Classes/Domain/Repository/PersonRepository.php: -------------------------------------------------------------------------------- 1 | 26 | */ 27 | class PersonRepository extends Repository 28 | { 29 | protected $defaultOrderings = ['lastname' => QueryInterface::ORDER_ASCENDING]; 30 | } 31 | -------------------------------------------------------------------------------- /Resources/Private/Language/plugin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Options 7 | 8 | 9 | 10 | 11 | Max. number of items to display per page 12 | 13 | 14 | 15 | 16 | List of Blogs (BlogExample) 17 | 18 | 19 | 20 | 21 | Display a list of blogs 22 | 23 | 24 | 25 | 26 | Admin Plugin (BlogExample) 27 | 28 | 29 | 30 | 31 | Administrate the blog 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configuration/TCA/Overrides/tt_content.php: -------------------------------------------------------------------------------- 1 | addError($errorString, 1297418976); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Classes/ExpressionLanguage/ExtensionConfigurationProvider.php: -------------------------------------------------------------------------------- 1 | expressionLanguageVariables = [ 20 | 'blogConfiguration' => $configuration->get('blog_example'), 21 | ]; 22 | } catch (ExtensionConfigurationExtensionNotConfiguredException | ExtensionConfigurationPathDoesNotExistException) { 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Classes/Domain/Repository/BlogRepository.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | class BlogRepository extends Repository 29 | { 30 | protected $defaultOrderings = [ 31 | 'crdate' => QueryInterface::ORDER_DESCENDING, 32 | 'uid' => QueryInterface::ORDER_DESCENDING, 33 | ]; 34 | } 35 | -------------------------------------------------------------------------------- /Resources/Private/Language/Module/locallang_mod.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | Blogs 8 | 9 | 10 | View/Modify Blogs 11 | 12 | 13 | Blogs 14 | 15 | 16 | Delete blog %s 17 | 18 | 19 | Delete all Blogs 20 | 21 | 22 | Create example data 23 | 24 | 25 | Blog Post 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Resources/Public/Icons/Extension.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Configuration/Sets/BlogExample/setup.typoscript: -------------------------------------------------------------------------------- 1 | # Plugin configuration 2 | plugin.tx_blogexample { 3 | settings { 4 | postsPerPage = {$blogExample.postsPerPage} 5 | editorUsergroupUid = {$blogExample.editorUsergroupUid} 6 | defaultGravator = {$blogExample.defaultGravator} 7 | } 8 | 9 | persistence { 10 | storagePid = {$blogExample.storagePid} 11 | } 12 | 13 | view { 14 | templateRootPaths.10 = {$blogExample.templateRootPath} 15 | partialRootPaths.10 = {$blogExample.partialRootPath} 16 | layoutRootPaths.10 = {$blogExample.layoutRootPath} 17 | defaultPid = auto 18 | } 19 | 20 | # This is an example how to modify the translation 21 | _LOCAL_LANG { 22 | default { 23 | someUnusedKey = foo 24 | } 25 | } 26 | } 27 | 28 | # Make postlist available as lib.blog_example_post_list 29 | 30 | lib.blog_example_post_list < tt_content.list.20.blogexample_postlist 31 | 32 | # Configure page title provider for blog post indexAction and showAction 33 | config { 34 | pageTitleProviders { 35 | blogExample { 36 | provider = T3docs\BlogExample\PageTitle\BlogPageTitleProvider 37 | before = record 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Configuration/Extbase/Persistence/Classes.php: -------------------------------------------------------------------------------- 1 | [ 12 | 'tableName' => 'fe_users', 13 | 'recordType' => Administrator::class, 14 | 'properties' => [ 15 | 'administratorName' => [ 16 | 'fieldName' => 'username', 17 | ], 18 | ], 19 | ], 20 | FrontendUserGroup::class => [ 21 | 'tableName' => 'fe_groups', 22 | ], 23 | Blog::class => [ 24 | 'tableName' => 'tx_blogexample_domain_model_blog', 25 | 'properties' => [ 26 | 'categories' => [ 27 | 'fieldName' => 'category', 28 | ], 29 | ], 30 | ], 31 | Post::class => [ 32 | 'tableName' => 'tx_blogexample_domain_model_post', 33 | 'properties' => [ 34 | 'categories' => [ 35 | 'fieldName' => 'category', 36 | ], 37 | ], 38 | ], 39 | ]; 40 | -------------------------------------------------------------------------------- /Classes/Service/BlogValidationService.php: -------------------------------------------------------------------------------- 1 | maxCategoryCount = $maxCategoryCount; 29 | } 30 | 31 | public function isBlogCategoryCountValid(Blog $blog): bool 32 | { 33 | return $blog->getCategories()->count() <= $this->maxCategoryCount; 34 | } 35 | 36 | public function isBlogSubtitleValid(Blog $blog): bool 37 | { 38 | return strtolower($blog->getTitle()) !== strtolower($blog->subtitle ?? ''); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Resources/Public/Icons/module-blog.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Classes/Domain/Model/Tag.php: -------------------------------------------------------------------------------- 1 | name; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change log 2 | 3 | All notable changes to this project will be documented in this file. 4 | This project adheres to [Semantic Versioning](https://semver.org/). 5 | 6 | 7 | ## Unreleased 8 | 9 | ### Fixed 10 | - Add return type to `ModuleController->initializeAction()` (#74) 11 | 12 | ## 12.1.0 - 2024-04-15 13 | 14 | ### Added 15 | - Add page title provider for blog post indexAction and showAction (#43) 16 | 17 | ### Fixed 18 | - Update locallang_db.xlf - missing field names added (#76) 19 | - Correct the integration of categories (#77) 20 | - Invoke addFlashMessage() correctly when deleting a post or a blog (#83, #86) 21 | 22 | ## 12.0.4 - 2023-09-16 23 | 24 | ### Fixed 25 | - Remove superfluous CSH language file (#57) 26 | - Streamline XLIFF files (#58) 27 | 28 | ## 12.0.3 - 2023-08-07 29 | 30 | ### Fixed 31 | - Substitute ExtensionManagementUtility::getFileFieldTCAConfig() with TCA file type (#48) 32 | 33 | ## 12.0.2 - 2022-10-09 34 | 35 | ### Changed 36 | - The main branch was renamed from `master` to `main` 37 | 38 | ### Fixed 39 | - Fix `Services.yaml` for type converter example (#41) 40 | 41 | ## 12.0.1 - 2022-10-07 42 | 43 | ### Added 44 | - Add TypeConverter examples (#34) 45 | 46 | ### Changed 47 | - Changed the vendor to t3docs (#40) 48 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: help 2 | help: ## Displays this list of targets with descriptions 3 | @echo "The following commands are available:\n" 4 | @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' 5 | 6 | .PHONY: install 7 | install: ## Run rector 8 | Build/Scripts/runTests.sh -s composerUpdate 9 | 10 | .PHONY: install-rector 11 | install-rector: ## Run rector 12 | Build/Scripts/runTests.sh -s composerUpdateRector 13 | 14 | .PHONY: rector 15 | rector: ## Run rector 16 | Build/Scripts/runTests.sh -s rector 17 | 18 | .PHONY: fix-cs 19 | fix-cs: ## Fix PHP coding styles 20 | Build/Scripts/runTests.sh -s cgl 21 | 22 | .PHONY: fix 23 | fix: rector fix-cs## Run rector and cgl fixes 24 | 25 | .PHONY: phpstan 26 | phpstan: ## Run phpstan tests 27 | Build/Scripts/runTests.sh -s phpstan 28 | 29 | .PHONY: phpstan-baseline 30 | phpstan-baseline: ## Update the phpstan baseline 31 | Build/Scripts/runTests.sh -s phpstanBaseline 32 | 33 | .PHONY: test 34 | test: fix-cs phpstan test-unit test-functional## Run all tests 35 | 36 | .PHONY: test-unit 37 | test-unit: ## Run unit tests 38 | Build/Scripts/runTests.sh -s unit 39 | 40 | .PHONY: test-functional 41 | test-functional: ## Run functional tests 42 | Build/Scripts/runTests.sh -s functional -d mysql 43 | -------------------------------------------------------------------------------- /Configuration/Icons.php: -------------------------------------------------------------------------------- 1 | [ 9 | // icon provider class 10 | 'provider' => SvgIconProvider::class, 11 | // the source SVG for the SvgIconProvider 12 | 'source' => 'EXT:blog_example/Resources/Public/Icons/Extension.svg', 13 | ], 14 | 'blogexample_blog' => [ 15 | 'provider' => BitmapIconProvider::class, 16 | 'source' => 'EXT:blog_example/Resources/Public/Icons/icon_tx_blogexample_domain_model_blog.gif', 17 | ], 18 | 'blogexample_comment' => [ 19 | 'provider' => BitmapIconProvider::class, 20 | 'source' => 'EXT:blog_example/Resources/Public/Icons/icon_tx_blogexample_domain_model_comment.gif', 21 | ], 22 | 'blogexample_person' => [ 23 | 'provider' => BitmapIconProvider::class, 24 | 'source' => 'EXT:blog_example/Resources/Public/Icons/icon_tx_blogexample_domain_model_person.gif', 25 | ], 26 | 'blogexample_post' => [ 27 | 'provider' => BitmapIconProvider::class, 28 | 'source' => 'EXT:blog_example/Resources/Public/Icons/icon_tx_blogexample_domain_model_post.gif', 29 | ], 30 | 'blogexample_tag' => [ 31 | 'provider' => BitmapIconProvider::class, 32 | 'source' => 'EXT:blog_example/Resources/Public/Icons/icon_tx_blogexample_domain_model_tag.gif', 33 | ], 34 | ]; 35 | -------------------------------------------------------------------------------- /Classes/Domain/Validator/PostValidator.php: -------------------------------------------------------------------------------- 1 | postValidationService->isTitleValid($value)) { 41 | $error = new Error('Title custom validation failed', 1480872650); 42 | $this->result->forProperty('title')->addError($error); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Resources/Private/Backend/Templates/ShowBlog.html: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 |

Posts of Blog "{blog.title}"

10 |

{blog.description}

11 |
12 | 13 | 14 |
    15 | 16 |
  • 17 |

    18 | 19 | 20 | {post.title} 21 | 22 |

    23 |

    24 | {post.content} 25 |

    26 |
  • 27 |
    28 |
29 |
30 | 31 |

This blog currently doesn't contain any posts.

32 |
33 |
34 |
35 |
36 | 37 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribute to this extension 2 | 3 | For help about contributing to the documentation in general, see https://docs.typo3.org/typo3cms/HowToDocument/ 4 | 5 | You are welcome to contribute to this example extension. Please note that the code is used in different manuals 6 | to demonstrate certain features of TYPO3 and Extbase. 7 | 8 | Talk to us on Slack, channel #typo3-documentation or open an [issue](https://github.com/TYPO3-Documentation/blog_example/issues) to be sure 9 | that your intended changes are fitting the didactics of these manuals. 10 | 11 | ## Run tests and apply coding guidelines 12 | 13 | The blog-example comes with a simple demo set of tests. It relies 14 | on the runTests.sh script which is a simplified version of a similar script from the TYPO3 core. 15 | Find detailed usage examples by executing `Build/Scripts/runTests.sh -h` and have a look at 16 | `.github/workflows/tests.yml` to see how this is used in CI. 17 | 18 | Install the requirements: 19 | 20 | ``` 21 | make install 22 | ``` 23 | 24 | Apply rector and automatic coding guideline fixes: 25 | 26 | ``` 27 | make fix 28 | ``` 29 | 30 | Run tests: 31 | 32 | ``` 33 | make test 34 | ``` 35 | 36 | See help: 37 | 38 | ``` 39 | make 40 | ``` 41 | 42 | If you have no `make` installed or which for finer control, you can run the tests directly: 43 | 44 | ``` 45 | Build/Scripts/runTests.sh -s h 46 | ``` 47 | 48 | # General TYPO3 Support 49 | 50 | If you have some general TYPO3 support questions or need help with TYPO3, please see https://typo3.org/help. 51 | -------------------------------------------------------------------------------- /Classes/Domain/Model/Info.php: -------------------------------------------------------------------------------- 1 | name; 34 | } 35 | 36 | public function setName(string $name): void 37 | { 38 | $this->name = $name; 39 | } 40 | 41 | public function getBodytext(): string 42 | { 43 | return $this->bodytext; 44 | } 45 | 46 | public function setBodytext(string $bodytext): void 47 | { 48 | $this->bodytext = $bodytext; 49 | } 50 | 51 | public function getCombinedString(): string 52 | { 53 | return $this->name . ': ' . $this->bodytext; 54 | } 55 | 56 | public function __toString(): string 57 | { 58 | return $this->name; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Resources/Private/Backend/Templates/ShowAllComments.html: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 |
10 |

List of all comments

11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | {comment.author} posted on 19 | {comment.date} 20 | 21 |
22 |
23 | {comment.content} 24 |
25 |
26 |
27 |
28 |
29 | 30 |

This blog currently doesn't contain any comments.

31 |
32 |
33 |
34 |
35 | 36 | -------------------------------------------------------------------------------- /Classes/Domain/Repository/CommentRepository.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | class CommentRepository extends Repository 29 | { 30 | protected $defaultOrderings = ['date' => QueryInterface::ORDER_DESCENDING]; 31 | 32 | public function initializeObject(): void 33 | { 34 | $querySettings = $this->createQuery()->getQuerySettings(); 35 | // Show comments from all pages 36 | $querySettings->setRespectStoragePage(false); 37 | $this->setDefaultQuerySettings($querySettings); 38 | } 39 | 40 | /** 41 | * @return QueryResultInterface 42 | */ 43 | public function findAllIgnoreEnableFields(): QueryResultInterface 44 | { 45 | $query = $this->createQuery(); 46 | $query->getQuerySettings()->setIgnoreEnableFields(true); 47 | return $query->execute(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /ext_localconf.php: -------------------------------------------------------------------------------- 1 | 'index', 19 | PostController::class => 'index, show', 20 | CommentController::class => 'create', 21 | ], 22 | [ 23 | CommentController::class => 'create', 24 | ], 25 | ); 26 | 27 | // RSS Feed 28 | ExtensionUtility::configurePlugin( 29 | $extensionName, 30 | 'PostListRss', 31 | // Cache-able Controller-Actions 32 | [ 33 | PostController::class => 'displayRssList', 34 | ], 35 | [], 36 | ); 37 | 38 | // admin plugins 39 | ExtensionUtility::configurePlugin( 40 | $extensionName, 41 | 'BlogAdmin', 42 | // Cache-able Controller-Actions 43 | [ 44 | BlogController::class => 'new,create,delete,deleteAll,edit,update,populate', 45 | PostController::class => 'new,create,delete,edit,update', 46 | CommentController::class => 'delete', 47 | ], 48 | // Non-Cache-able Controller-Actions 49 | [ 50 | BlogController::class => 'create,delete,deleteAll,update,populate', 51 | PostController::class => 'create,delete,update', 52 | CommentController::class => 'delete', 53 | ], 54 | ); 55 | })('BlogExample'); 56 | -------------------------------------------------------------------------------- /Resources/Private/Partials/BlogForm.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 |
6 |
7 | 10 |
11 |
12 | 13 |
14 |
15 | 18 |
19 |
20 |