-
Notifications
You must be signed in to change notification settings - Fork 82
[v5] Fixed invalid code sample includes #2967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 5.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While in this file, I would also fix this weird indent in |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wrong highlight, two much new line feeds, and maybe an unneeded capital (I can't make a nice suggestion for some "deleted lines" reason): |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,8 +20,8 @@ Value objects such as content items are read-only, so to create or modify them y | |||||
| [`ContentService::newContentCreateStruct`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-ContentService.html#method_newContentCreateStruct) | ||||||
| returns a new [`ContentCreateStruct`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-ContentCreateStruct.html) object. | ||||||
|
|
||||||
| ``` php hl_lines="1-2 6" | ||||||
| [[= include_file('code_samples/api/public_php_api/src/Command/CreateContentCommand.php', 47, 53) =]] | ||||||
| ``` php hl_lines="2-3 7" | ||||||
| [[= include_file('code_samples/api/public_php_api/src/Command/CreateContentCommand.php', 51, 60) =]] | ||||||
| ``` | ||||||
|
|
||||||
| This command creates a draft using [`ContentService::createContent`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-ContentService.html#method_createContent) (line 6). | ||||||
|
|
@@ -42,7 +42,7 @@ Therefore, when creating a content item of the Image type (or any other content | |||||
| the `ContentCreateStruct` is slightly more complex than in the previous example: | ||||||
|
|
||||||
| ``` php | ||||||
| [[= include_file('code_samples/api/public_php_api/src/Command/CreateImageCommand.php', 47, 62) =]] | ||||||
| [[= include_file('code_samples/api/public_php_api/src/Command/CreateImageCommand.php', 51, 63) =]] | ||||||
| ``` | ||||||
|
|
||||||
| Value of the Image field type contains the path to the image file and other basic information based on the input file. | ||||||
|
|
@@ -66,7 +66,7 @@ To publish it, use [`ContentService::publishVersion`](/api/php_api/php_api_refer | |||||
| This method must get the [`VersionInfo`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-VersionInfo.html) object of a draft version. | ||||||
|
|
||||||
| ``` php | ||||||
| [[= include_file('code_samples/api/public_php_api/src/Command/CreateContentCommand.php', 58, 59) =]] | ||||||
| [[= include_file('code_samples/api/public_php_api/src/Command/CreateContentCommand.php', 62, 63) =]] | ||||||
| ``` | ||||||
|
|
||||||
| ## Updating content | ||||||
|
|
@@ -76,7 +76,7 @@ and pass it to [`ContentService::updateContent`](/api/php_api/php_api_reference/ | |||||
| This method works on a draft, so to publish your changes you need to use [`ContentService::publishVersion`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-ContentService.html#method_publishVersion) as well: | ||||||
|
|
||||||
| ``` php | ||||||
| [[= include_file('code_samples/api/public_php_api/src/Command/UpdateContentCommand.php', 45, 50) =]] | ||||||
| [[= include_file('code_samples/api/public_php_api/src/Command/UpdateContentCommand.php', 44, 53) =]] | ||||||
| ``` | ||||||
|
|
||||||
| ## Translating content | ||||||
|
|
@@ -86,15 +86,16 @@ Content [translations](languages.md#language-versions) are created per version. | |||||
| To translate a content item to a new language, you need to update it and provide a new `initialLanguageCode`: | ||||||
|
|
||||||
| ``` php | ||||||
| [[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 50, 52) =]] | ||||||
| [[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 58, 60) =]] | ||||||
| [[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 49, 55) =]] | ||||||
|
|
||||||
| [[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 60, 63) =]] | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||
| ``` | ||||||
|
|
||||||
| You can also update content in multiple languages at once using the `setField` method's third argument. | ||||||
| Only one language can still be set as a version's initial language: | ||||||
|
|
||||||
| ``` php | ||||||
| [[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 55, 55) =]] | ||||||
| [[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 57, 58) =]] | ||||||
| ``` | ||||||
|
|
||||||
| ### Deleting a translation | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The #tab-order section is to be fixed too.
https://doc.ibexa.co/en/4.6/administration/back_office/back_office_tabs/back_office_tabs/#tab-order
https://doc.ibexa.co/en/5.0/administration/back_office/back_office_tabs/back_office_tabs/#tab-order doesn't display the
getOrderfunction