Module http://lobsterr.me/ en How to check that module installed in Drupal 9? http://lobsterr.me/post/how-check-module-installed-drupal-9 <span class="field field--name-title field--type-string field--label-hidden">How to check that module installed in Drupal 9?</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">LOBsTerr</span></span> <span class="field field--name-created field--type-created field--label-hidden">07/14/2021</span> <div class="field field--name-f-content field--type-entity-reference-revisions field--label-hidden field__items"> <div class="field__item"> <div class="paragraph paragraph--type--l-text paragraph--view-mode--default"> <div class="clearfix text-formatted field field--name-f-text field--type-text-long field--label-hidden field__item"><pre> <code class="language-php">if (\Drupal::service('module_handler')-&gt;moduleExists('locale')) { // your code here }</code></pre> <p> </p> </div> </div> </div> </div> <div class="field field--name-f-tags field--type-entity-reference field--label-hidden field__items"> <div class="field__item btn btn-secondary"><a href="/tags/drupal-9" hreflang="en">Drupal 9</a></div> <div class="field__item btn btn-secondary"><a href="/tags/module" hreflang="en">Module</a></div> </div> <section class="field field--name-f-comments field--type-comment field--label-above comment-wrapper"> </section> Wed, 14 Jul 2021 09:03:12 +0000 LOBsTerr 45 at http://lobsterr.me How to display / place a block based on route in Drupal? http://lobsterr.me/post/how-display-place-block-based-route-drupal <span class="field field--name-title field--type-string field--label-hidden">How to display / place a block based on route in Drupal?</span> <div class="field field--name-f-intro field--type-string-long field--label-hidden field__item">By default Drupal provides and option to set visibility of block based on path, but quite often it is not what actually want.</div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">LOBsTerr</span></span> <span class="field field--name-created field--type-created field--label-hidden">02/16/2021</span> <div class="field field--name-f-content field--type-entity-reference-revisions field--label-hidden field__items"> <div class="field__item"> <div class="paragraph paragraph--type--l-text paragraph--view-mode--default"> <div class="clearfix text-formatted field field--name-f-text field--type-text-long field--label-hidden field__item"><p>To solve this issue we can use a small, but a very useful module <a href="https://www.drupal.org/project/route_condition">Route condition</a>. This module provides condition plugin, which will display the block based on routes. Basically it works the same way as Pages condition plugin. So, I believe you will not find any issues configure it.<br />  </p> </div> </div> </div> </div> <div class="field field--name-f-tags field--type-entity-reference field--label-hidden field__items"> <div class="field__item btn btn-secondary"><a href="/tags/drupal-9" hreflang="en">Drupal 9</a></div> <div class="field__item btn btn-secondary"><a href="/tags/module" hreflang="en">Module</a></div> </div> <section class="field field--name-f-comments field--type-comment field--label-above comment-wrapper"> </section> Tue, 16 Feb 2021 22:31:00 +0000 LOBsTerr 39 at http://lobsterr.me How prepopulate values on a form from request in Drupal? http://lobsterr.me/post/how-prepopulate-values-form-request-drupal <span class="field field--name-title field--type-string field--label-hidden">How prepopulate values on a form from request in Drupal?</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">LOBsTerr</span></span> <span class="field field--name-created field--type-created field--label-hidden">02/16/2021</span> <div class="field field--name-f-content field--type-entity-reference-revisions field--label-hidden field__items"> <div class="field__item"> <div class="paragraph paragraph--type--l-text paragraph--view-mode--default"> <div class="clearfix text-formatted field field--name-f-text field--type-text-long field--label-hidden field__item"><p>Let's imagine we have a node with field category and we want to create a link in the view and pass a category in the request ?field_category=1. Unfortunately, it will not like this by default. Fortunately, we have a solution! We need a module <a href="https://www.drupal.org/project/prepopulate">prepopulated</a> and pass a parameter a special way:<br /><br /> 1) For entity reference fields</p> <pre> <code class="language-php">http://yourdoamain.com/node/add/page?edit[field_category][widget][0][target_id]=1</code></pre> <p>2) Normal fields</p> <pre> <code class="language-php">http://yourdoamain.com/node/add/page?edit[field_body][widget][0][value]=Something</code></pre> </div> </div> </div> </div> <div class="field field--name-f-tags field--type-entity-reference field--label-hidden field__items"> <div class="field__item btn btn-secondary"><a href="/tags/module" hreflang="en">Module</a></div> <div class="field__item btn btn-secondary"><a href="/tags/drupal-9" hreflang="en">Drupal 9</a></div> </div> <section class="field field--name-f-comments field--type-comment field--label-above comment-wrapper"> </section> Tue, 16 Feb 2021 16:23:42 +0000 LOBsTerr 38 at http://lobsterr.me