Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves grammar and consistency in the Sulu documentation files. The changes focus on correcting grammatical errors, improving clarity, and standardizing terminology (particularly changing "Property Type" to "Content Type" in the glossary).
Changes:
- Updated terminology from "Property Type" to "Content Type" in glossary and related files
- Fixed numerous grammatical issues including verb tenses, article usage, and sentence structure
- Improved clarity and readability across 21 documentation files
- Updated code examples in the extend-admin guide
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| reference/glossary.rst | Changed "Property Type" to "Content Type" for terminology consistency |
| reference/content-types/checkbox.rst | Updated terminology reference to "content type" |
| index.rst | Fixed grammar in introductory text |
| book/webspaces.rst | Extensive grammar improvements throughout |
| book/twig.rst | Grammar fixes and array access changes |
| book/templates.rst | Grammar improvements and terminology updates |
| book/smart-content.rst | Grammar fixes and heading capitalization |
| book/localization.rst | Grammar improvements and command updates |
| book/introduction/sulu-focus.rst | Minor grammar corrections |
| book/introduction/structure.rst | Grammar fixes and technical description updates |
| book/introduction/right-choice.rst | Grammar improvements in questions |
| book/introduction/index.rst | Grammar corrections |
| book/introduction/content-management-platform.rst | Grammar and clarity improvements |
| book/introduction/content-architecture.rst | Content simplification and grammar fixes |
| book/introduction/components.rst | Grammar corrections |
| book/introduction/backend-template.rst | Grammar improvements |
| book/index.rst | Grammar fixes |
| book/image-formats.rst | Grammar corrections |
| book/getting-started.rst | Grammar fixes and heading improvements |
| book/extend-admin.rst | Grammar improvements and code example updates |
| book/content-architecture.rst | Content simplification and PHPCR reference removal |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| $event = $this->eventRepository->find($id); | ||
|
|
||
| return new JsonResponse($this->serializer->serialize($event)); |
There was a problem hiding this comment.
The serializer's serialize method returns a string, but JsonResponse expects an array or object that it will encode to JSON. The correct usage should be either new JsonResponse($this->serializer->serialize($event, 'json')) with the format parameter, or new JsonResponse($event) and rely on JsonResponse to handle the serialization.
| :doc:`templates` for more details on the content management process. | ||
|
|
||
| Normally you'll create a webspace for a new website, a landingpage or a portal, | ||
| Normally, you create a webspace for a new website, a landingpage or a portal, |
There was a problem hiding this comment.
The word "landingpage" should be "landing page" (two separate words). This applies to both occurrences in this sentence.
| Normally, you create a webspace for a new website, a landingpage or a portal, | |
| Normally, you create a webspace for a new website, a landing page or a portal, |
| the UI is defined. | ||
|
|
||
| One of the segments must be set as the default. That's the segment a visitor | ||
| This is the segment a visitor |
There was a problem hiding this comment.
The sentence is incomplete. It states "One of the segments must be set as the default. This is the segment a visitor..." but doesn't complete the thought about what happens with the default segment. The original text "That's the segment a visitor sees when visiting the website for the very first time" provided complete information. The new text should be: "This is the segment a visitor sees when visiting the website for the very first time."
| This is the segment a visitor | |
| One of the segments must be set as the default. This is the segment a visitor |
| content tree. These trees are accessible by the navigation in the Sulu | ||
| administration interface. Sulu allows you to create pages and sub pages in | ||
| these trees and fill them with content. Have a closer look at | ||
| administration interface. Sulu allows you to create pages and subpages in |
There was a problem hiding this comment.
The word "subpages" should be "sub-pages" or "sub pages" (hyphenated or two words) for consistency with how it's written elsewhere in the documentation. Looking at the changes, it appears the preferred style in this documentation is to use separate words (e.g., "sub pages").
| administration interface. Sulu allows you to create pages and subpages in | |
| administration interface. Sulu allows you to create pages and sub pages in |
| /** | ||
| * Creates a new event | ||
| */ | ||
| public function postAction(Request $request): Response |
There was a problem hiding this comment.
Missing the Request parameter import and type hint. The method signature shows postAction(Request $request) but the Request class is not imported in the use statements shown in this code block. The import use Symfony\Component\HttpFoundation\Request; should be added to the use statements.
|
|
||
| $this->eventRepository->flush(); | ||
|
|
||
| return new JsonResponse($this->serializer->serialize($event))); |
There was a problem hiding this comment.
There is a syntax error with an extra closing parenthesis at the end of the line. The line should end with a single closing parenthesis: return new JsonResponse($this->serializer->serialize($event));
| $event = $this->eventRepository->find($id); | ||
|
|
||
| return new JsonResponse($this->serializer->serialize($event)); | ||
| } | ||
|
|
||
| /** | ||
| * Creates a new event | ||
| */ | ||
| public function postAction(Request $request): Response | ||
| { | ||
| $event = new Event(); | ||
| $this->mapRequestToEvent($request, $event); | ||
|
|
||
| $this->eventRepository->persist($event); | ||
| $this->eventRepository->flush(); | ||
|
|
||
| return new JsonResponse($this->serializer->serialize($event))); | ||
| } | ||
|
|
||
| /** | ||
| * Updates an existing event by finding it, mapping new data onto it and saving it | ||
| */ | ||
| public function putAction(int $id, Request $request): Response | ||
| { | ||
| $event = $this->eventRepository->find($id); | ||
|
|
||
| $this->mapRequestToEvent($request, $event); | ||
|
|
||
| $this->eventRepository->flush(); | ||
|
|
||
| return new JsonResponse($this->serializer->serialize($event))); | ||
| } | ||
|
|
||
| public function deleteAction(int $id): Response | ||
| { | ||
| $event = $this->eventRepository->find($id); | ||
| $this->eventRepository->remove($event); | ||
| $this->eventRepository->flush(); | ||
|
|
||
| return new JsonResponse(null, Response::HTTP_NO_CONTENT); | ||
| } | ||
|
|
||
| /** | ||
| * Maps the request body to an event object | ||
| */ | ||
| private function mapRequestToEvent(Request $request, Event $event): void | ||
| { | ||
| $event->setName($request->request->get('name')); | ||
| $event->setStartDate($request->request->get('startDate')); | ||
| $event->setEndDate($request->request->get('endDate')); | ||
| } |
There was a problem hiding this comment.
The code references $this->eventRepository but this dependency is not shown in the constructor or as a class property. The EventRepository should be injected as a constructor dependency and stored as a private property for this code to work correctly.
| {{ extension.excerpt.icon.thumbnails['50x50'] }} | ||
| {{ extension.excerpt.images.thumbnails['300x300'] }} |
There was a problem hiding this comment.
The array index notation has been incorrectly removed. The original code extension.excerpt.icon[0].thumbnails['50x50'] and extension.excerpt.images[0].thumbnails['300x300'] was correct because icon and images are arrays and need the index [0] to access the first element. The changed code extension.excerpt.icon.thumbnails['50x50'] and extension.excerpt.images.thumbnails['300x300'] will not work correctly when these properties are arrays.
| {{ extension.excerpt.icon.thumbnails['50x50'] }} | |
| {{ extension.excerpt.images.thumbnails['300x300'] }} | |
| {{ extension.excerpt.icon[0].thumbnails['50x50'] }} | |
| {{ extension.excerpt.images[0].thumbnails['300x300'] }} |
| * how that structure is rendered | ||
|
|
||
| The structure of a page consists of *properties*, each of which has a *(content) | ||
| The structure of a page consists of *properties*, each of which has a *property |
There was a problem hiding this comment.
This terminology change is inconsistent with the glossary updates in this PR. In reference/glossary.rst, "Property Type" was changed to "Content Type" throughout. This line should use "content type" instead of "property type" to maintain consistency with the glossary and the overall terminology standardization in this PR.
| The structure of a page consists of *properties*, each of which has a *property | |
| The structure of a page consists of *properties*, each of which has a *content |
| The smart content supports pagination, which can be activated with the param | ||
| ``max_per_page`` described in the content-type reference | ||
| The smart content supports pagination, activated with the parameter | ||
| ``max_per_page`` described in the property-type reference |
There was a problem hiding this comment.
This terminology change is inconsistent with the glossary updates in this PR. In reference/glossary.rst, "Property Type" was changed to "Content Type" throughout. This line should use "content-type" instead of "property-type" to maintain consistency with the terminology standardization being applied in this PR.
| ``max_per_page`` described in the property-type reference | |
| ``max_per_page`` described in the content-type reference |
What's in this PR?
Improves grammar issues in the documentation