-
Notifications
You must be signed in to change notification settings - Fork 118
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
Update localization.rst: Added a note how to get the current locale #803
Closed
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
91d7e0d
Add support for avif image formats (#755)
vinceAmstoutz ddaaa7b
Merge branch '2.5' of github.com:sulu/sulu-docs into 2.x
alexander-schranz 3fe85af
Add comment about Symfony 5 for anonymous flag (#758)
alexander-schranz 88ec73b
Add missing provider sulu (#759)
alexander-schranz f5ac3c8
Fix azure blob storage connection_string (#760)
alexander-schranz 95f0c27
Merge branch '2.5' of github.com:sulu/sulu-docs into 2.x
alexander-schranz 874af76
Fix invalid YAML syntax (#768)
matthiasseghers 5695af2
Add controller.service_arguments tag (#769)
remdan bc507fb
Add custom sorting documentation (#770)
matthiasseghers 25c9f6f
Add documentation for sulu-link "remove-if-not-exists" (#773)
mamazu 97ac534
Merge branch '2.5' of github.com:sulu/sulu-docs into 2.x
alexander-schranz 04a8a07
Merge branch '2.5' of github.com:sulu/sulu-docs into 2.x
alexander-schranz 93c8613
Fix html code blocks in link docs (#783)
alexander-schranz b01584c
Add hint to use bun to build admin (#782)
alexander-schranz 8b4a385
Add documentation for snippet area cache settings (#788)
Prokyonn bf0a10a
Add mapquest to location documentation (#789)
martinlagler 6093d42
Add documentation for global-blocks (#787)
wachterjohannes db4f946
Merge branch '2.5' of github.com:sulu/sulu-docs into 2.x
alexander-schranz 7e7603f
Extend Docs for Admin View Debug Command (#793)
TheCadien 67a3c6a
Add reference bundle documentation (#795)
Prokyonn 2e197e8
Merge branch '2.5' of github.com:sulu/sulu-docs into 2.x
alexander-schranz 7b3228b
Add cleanup phpcr database (#791)
wachterjohannes 2d09555
Merge branch '2.5' of github.com:sulu/sulu-docs into 2.x
alexander-schranz 45b5a6b
Add single sign on documentation (#792)
martinlagler 8c49c28
Merge branch '2.5' of github.com:sulu/sulu-docs into 2.x
alexander-schranz d513a63
Bump Version
alexander-schranz 642db14
Simplify global blocks example to ref (#798)
alexander-schranz 43af68c
Update requirements for Sulu 2.6 (#799)
alexander-schranz 13881e7
Merge branch '2.6' of github.com:sulu/sulu-docs into 2.x
alexander-schranz d671cd9
Fix some basic docs styling
alexander-schranz ef86dac
Merge branch '2.5' of github.com:sulu/sulu-docs into 2.6
alexander-schranz aaac7ab
Merge branch '2.6' of github.com:sulu/sulu-docs into 2.x
alexander-schranz f94fb66
Fix refernce bundle paragraph spaces (#801)
alexander-schranz beb04cc
Fix refernce bundle paragraph spaces (#801)
alexander-schranz 5e39304
Simplify global blocks example to ref (#798)
alexander-schranz cc83cb1
Merge branch '2.6' of github.com:sulu/sulu-docs into 2.x
alexander-schranz 0c06bc3
Update localization.rst: Added a note how to get the current locale
spackmat cd2ce6a
Merge branch '2.5' of github.com:sulu/sulu-docs into 2.6
alexander-schranz 2b7693b
Merge branch '2.6' of github.com:sulu/sulu-docs into 2.x
alexander-schranz 1418ef6
Merge branch 'sulu:2.x' into patch-1
spackmat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
ReferenceBundle | ||
=============== | ||
|
||
The ReferenceBundle is tasked with tracking references among entities within the application. | ||
It enables developers and maintainers to quickly determine the relationships between entities and understand the manner | ||
and location in which an entity is utilized. Presently, the ReferenceBundle is capable of monitoring the usage of Snippets and | ||
Media within PHPCR entities such as `pages` and `snippets`. These references are managed distinctly for the draft | ||
state within the `admin context` and the live state within the `website context`. | ||
|
||
The main reason we need this bundle is that, unlike traditional database references, our content management system | ||
operates on an unstructured data model. Therefore, we cannot rely solely on database references, which are usually preferred. | ||
It is essential to note that the ReferenceBundle should only be used for unstructured data, where database relations are | ||
not feasible. | ||
|
||
Content maintainers are able to see the references to a specific entity in the `Insights` tab of an entity like `Snippet`. | ||
|
||
.. figure:: ../img/snippet-insights.png | ||
:alt: Snippet References | ||
|
||
Snippet References | ||
|
||
Refresh references | ||
------------------ | ||
|
||
The references are automatically updated upon saving an entity. You also have the option to manually update the | ||
references by executing the `bin/console sulu:references:refresh` command. This command optionally accepts the | ||
<resource-key> argument. When this argument is provided, only the references for the specified resource key will be refreshed. | ||
|
||
.. code-block:: bash | ||
|
||
bin/console sulu:references:refresh <resource-key> | ||
|
||
.. note:: | ||
|
||
Please note that references are only refreshed for the current context. To refresh the references for both the | ||
admin and website contexts, you will need to execute the command twice via the `bin/adminconsole` and the `bin/websiteconsole`. | ||
|
||
Integrating references for custom content-types | ||
----------------------------------------------- | ||
|
||
To integrate the ReferenceBundle for custom content-types, you need to implement the `ReferenceContentTypeInterface` in your | ||
content-type class. The interface requires you to implement the `getReferences` method. The method already receives the | ||
`ReferenceCollector` which you can use to add references to the collector. | ||
|
||
Example implementation for a custom content-type: | ||
|
||
.. code-block:: php | ||
|
||
public function getReferences(PropertyInterface $property, ReferenceCollectorInterface $referenceCollector, string $propertyPrefix = ''): void | ||
{ | ||
$data = $property->getValue(); | ||
if (!\is_array($data) || !isset($data['id'])) { | ||
return; | ||
} | ||
|
||
$referenceCollector->addReference( | ||
CustomEntity::RESOURCE_KEY, | ||
(string) $data['id'], | ||
$propertyPrefix . $property->getName() | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Cleanup PHPCR database | ||
====================== | ||
|
||
If you have an older installation of Sulu, you may be dealing with a database cluttered with outdated PHPCR properties. | ||
This is particularly common if you’ve made significant changes to your templates or content types over time. | ||
To tidy up your database, try running the following command: | ||
|
||
.. code-block:: bash | ||
php bin/console sulu:document:phpcr-cleanup | ||
The command is quite powerful, but exercise caution when deploying it in a production environment. | ||
It will remove all properties not currently utilized in your templates. To avoid potential pitfalls, ensure you have a | ||
backup of your database in place before executing this command. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We can use the
app.locale
for template may rendering in CLI context without a request object. That was added sometime ago by Symfony.symfony/symfony#49913