-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Derivatives Example Missing #51
Comments
@selwynpolit I have created example for Derivatives. It includes examples for Block and Menu Derivatives. It doesn't have much of description text but working example code. If you can have a look and give me feedback I can include Queue and Local Task derivatives as well. |
Thanks @bhanu951 What is your use case? I've never used these before and a quick google didn't return a very clear reason why we'd use these. |
ah, I found this: https://www.sitepoint.com/tutorial-on-using-drupal-8-plugin-derivatives-effectively/ |
and from https://www.drupal.org/docs/drupal-apis/plugin-api/plugin-api-overview |
@selwynpolit Block derivatives in Drupal 8+ are used to multiple blocks with arguments. Drupal 7 equivalent code is
|
One of the popular module using it https://www.drupal.org/project/menu_block |
@bhanu951 How does this look? https://selwynpolit.github.io/d9book/plugins#derivatives Feel free to add or change it. I really appreciate your extensive examples. I am curious if you have actually used this for a project and if you could describe the use case. |
It looks good but I think its good to have a separate section instead of it being sub-section in Plugins. As this topic is a rare one.
Its been long time(6-7 Years) since I used block derivatives. I don't remember all the details but , the requirement was to have a form where some calendar events are created and after events are created we need to create a new block and assign it to a region. Other use case was to display the latest published content from all the content types in separate blocks. Here is one good example for Queue Derivatives. And a good post in regards Derivatives |
Created PR #117 to include queue and local task derivatives. |
Here is the reference example for Block Derivative Example
The text was updated successfully, but these errors were encountered: