Edit option for content displayed on custom page

Hi,

I have a custom module that creates a custom page with some content. I need to have an edit button next to the content being displayed so that the people assigned the role of Editor is able to edit it. I have looked for online examples but found nothing helpful. 

Could you let me know how can I do it?

Thanks,

What is the simplest way to implement a hook on publishing specific content type?

I am asking becausee I haven't found any working solution or some good tutorial with files locations, files content and minimum files needed.

1. Can anyone confirm, that you cannot implement this type of hook (on publishing custom content type) in mytheme.theme?

Now I am digging web/core/lib/Drupal/core/Extension/ModuleHandler.php, and I start to suspect that I need a module - judging on implementation.

Does Drupal cache all or some hooks?

Hi,

So subject is the question.

I have custom theme. There are two two hooks there (in mytheme.theme):

mytheme_preprocess_html() and mytheme_preprocess_node().

When I set $settings['cache']['bins']['render'] = 'cache.backend.null' - both hooks are working.

When I remove this setting - mytheme_preprocess_html() continues to work fine everytime, but mytheme_preprocess_node() works only one time on page reload after clearing cache.

Is it normal or how to get all hooks working all the time regardless of cache setting?

getting error on database

I'm getting this error when I try to modify a content if you can help me

Fatal error: Cannot use Composer\Plugin\Capability\CommandProvider

Hello,

I succesfull installed the Drupal codebase with "composer create-project drupal/recommended-project".

Then I have "Fatal error: Cannot use Composer\Plugin\Capability\CommandProvider as CommandProvider because the name is already in use in phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php(196) : eval()'d code on line 10" after the "./composer.json has been updated" when I try to install DrupalConsole and Drush with "composer require drupal/console drush/drush".

Any idea how I can fix it ?

Thanks.

How to change mass routes?

 I have below kind of custom API URL's in different modules XX.routing.yml

custom_module:route_1
 path: "api/v0/abc"

custom_module:route_2
 path: "api/v0/def"

etc..

about more than 100.

Now I need to change the URL to

php/api/v0/abc, php/api/v0/def, etc/

Can we achieve this via RouterSubscriber?

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x