Skip to content

Commit

Permalink
Merge branch '2.6' of github.com:sulu/sulu-docs into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Sep 26, 2024
2 parents c04a950 + e57ca50 commit efcd7a7
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Sphinx Build
run: sphinx-build -n -W --keep-going -b html -d _build/doctrees . _build/html

- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
with:
name: DocumentationHTML
path: "_build/html"
33 changes: 33 additions & 0 deletions bundles/activity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,39 @@ users with a ``view`` permission for the context:
}
}
Extending the Admin View with a Activity Table
------------------------------------------------

To extend the admin view by adding a activities table, follow these steps:

1. Inject the `ActivityViewBuilderFactoryInterface`: Inject this interface into your custom Admin class. This will allow you to utilize the necessary methods to create the activities view.
2. Create the Activity List View: Use the `createActivityListViewBuilder` method to create the list view for the activities table.

Here’s an example implementation, demonstrating how to add the activities tab to your custom admin view, for further examples take a look at the SnippetAdmin class:

.. code-block:: php
if ($this->activityViewBuilderFactory->hasActivityListPermission()) {
$viewCollection->add(
$this->activityViewBuilderFactory
->createActivityListViewBuilder(
$insightsResourceTabViewName . '.activity',
'/activities',
CustomEntity::RESOURCE_KEY
)
->setParent($insightsResourceTabViewName)
);
}
The `hasActivityListPermission` method ensures that the current user has permission to view the activities list.
The `createActivityListViewBuilder` method is used to create the view. It takes three parameters:

- The name of the new view, usually appended with .activity to indicate it is an activity view.
- The URL path for the activities table.
- The resource key identifies the type of resource for the activities.

The setParent method sets the parent view to integrate the activities table into the existing admin view.

.. _Symfony event dispatcher: https://symfony.com/doc/current/event_dispatcher.html
.. _DomainEvent class: https://github.com/sulu/sulu/blob/2.x/src/Sulu/Bundle/ActivityBundle/Domain/Event/DomainEvent.php
.. _ActivityController class: https://github.com/sulu/sulu/blob/2.x/src/Sulu/Bundle/ActivityBundle/UserInterface/Controller/ActivityController.php#L377-L401
Expand Down
33 changes: 33 additions & 0 deletions bundles/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,36 @@ Example implementation for a custom content-type:
$propertyPrefix . $property->getName()
);
}
Extending the Admin View with a References Table
------------------------------------------------

To extend the admin view by adding a references table, follow these steps:

1. Inject the `ReferenceViewBuilderFactoryInterface`: Inject this interface into your custom Admin class. This will allow you to utilize the necessary methods to create the references view.
2. Create the Reference List View: Use the `createReferenceListViewBuilder` method to create the list view for the references table.

Here’s an example implementation from the `SnippetAdmin` class, demonstrating how to add the references tab to your custom admin view:

.. code-block:: php
if ($this->referenceViewBuilderFactory->hasReferenceListPermission()) {
$viewCollection->add(
$this->referenceViewBuilderFactory
->createReferenceListViewBuilder(
$insightsResourceTabViewName . '.reference',
'/references',
SnippetDocument::RESOURCE_KEY
)
->setParent($insightsResourceTabViewName)
);
}
The `hasReferenceListPermission` method ensures that the current user has permission to view the references list.
The `createReferenceListViewBuilder` method is used to create the view. It takes three parameters:

- The name of the new view, usually appended with .reference to indicate it is a reference view.
- The URL path for the references table.
- The resource key identifies the type of resource being referenced.

The setParent method sets the parent view to integrate the references table into the existing admin view.
2 changes: 1 addition & 1 deletion cookbook/web-server/nginx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The Nginx configuration could look something like.
# pass the PHP scripts to FastCGI server from upstream phpfcgi
location ~ ^/(index|config)\.php(/|$) {
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
Expand Down

0 comments on commit efcd7a7

Please sign in to comment.