<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: The Higgler Company</title>
    <description>The latest articles on DEV Community by The Higgler Company (@thehigglerscompany).</description>
    <link>https://dev.to/thehigglerscompany</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F7098%2F976ce7d5-1ac5-4e90-8c80-85824baea114.png</url>
      <title>DEV Community: The Higgler Company</title>
      <link>https://dev.to/thehigglerscompany</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thehigglerscompany"/>
    <language>en</language>
    <item>
      <title>Introduction to Drupal hook update</title>
      <dc:creator>Tejas Shah</dc:creator>
      <pubDate>Mon, 24 Apr 2023 20:51:36 +0000</pubDate>
      <link>https://dev.to/thehigglerscompany/introduction-to-drupal-hook-update-3016</link>
      <guid>https://dev.to/thehigglerscompany/introduction-to-drupal-hook-update-3016</guid>
      <description>&lt;h2&gt;
  
  
  Introduction to Drupal Hook Update
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Little Background
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;Drupal provides and update api to make changes to the stored data, whenever you make changes in your module or theme that is going to make your site’s exsisting data incompatible with the latest change you have made in the module or theme, there comes a need for Drupal update api.&lt;/p&gt;

&lt;p&gt;This api provides you with a way to make changes to the exsisting data stored so that you sites data is compatible with the latest version/change you made in you module/theme.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Where to write this hook update
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;The hook update is written in the module’s or theme’ &lt;code&gt;module_name.install&lt;/code&gt; file.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  How to write this hook update &amp;amp; its parameters
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the &lt;code&gt;module_name.install&lt;/code&gt; file we need to write the &lt;em&gt;hook_update_N()&lt;/em&gt; function and all the update code needs to go in this function.&lt;/p&gt;

&lt;p&gt;Wait thats not all, lets look at the naming convention and component of writing the &lt;em&gt;hook_update_N()&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So the hook_update_N() consist of three parts separated by underscore(_) symbol more on this is as described below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;hook&lt;/strong&gt; : This is part is to be update with the name of the module like &lt;em&gt;example-module&lt;/em&gt;_update_N(); this is similar to every other hooks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;update&lt;/strong&gt; : This is the keyword used to identify the hook. example-module_&lt;em&gt;update&lt;/em&gt;_N()&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;N (Capital N)&lt;/strong&gt; : This part is specific to hook_update_&lt;em&gt;N&lt;/em&gt;(). It is usually a 4 digit number like &lt;em&gt;8001&lt;/em&gt; or &lt;em&gt;9001&lt;/em&gt; This number is formed as below&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Parameters available in &lt;em&gt;hook_update_N()&lt;/em&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;array $sandbox: Stores information for batch updates.&lt;/p&gt;

&lt;p&gt;If your hook is going to use a batch update using drupal’s batch api then &amp;amp;$sandbox parameter is available and passed to the hook. More on &lt;a href="https://www.drupal.org/docs/7/api/batch-api/overview"&gt;sandbox&lt;/a&gt; variable.&lt;/p&gt;

&lt;p&gt;So for example below is the exact code showing the implementation of the hook update for a sample module named &lt;code&gt;example_module&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/**
 * Write a line or two here about what the updates are for.
 * This is shown to users on the update.php page.
 */
function mymodule_update_8001(&amp;amp;$sandbox) {

    *update code goes here 
*
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>How to configure xdebug with Lando &amp; VS code for Drupal Development</title>
      <dc:creator>Tejas Shah</dc:creator>
      <pubDate>Sat, 22 Apr 2023 21:18:11 +0000</pubDate>
      <link>https://dev.to/thehigglerscompany/how-to-configure-xdebug-with-lando-vs-code-for-drupal-development-254m</link>
      <guid>https://dev.to/thehigglerscompany/how-to-configure-xdebug-with-lando-vs-code-for-drupal-development-254m</guid>
      <description>&lt;p&gt;After ssearching for hours and many attempts I was able to connect my Lando based Drupal development enviornment with xdebug. As there is no straight forward resource available, you will find many artcles showing how to connect xdebug with phpstrom and lando but no resource is found across connecting xdebug with vscode lando.&lt;/p&gt;

&lt;p&gt;If you are also facing problem connecting vscode and lando with xdebug you have came to the right place in this article we will be looking at the same in a step by step manner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 : Installing VScode’s php xdebug extention
&lt;/h2&gt;

&lt;p&gt;We need to enable the php xedug extension for vs code, this can be enabled by navigating to extension manager in vs code and searching for “php Debug”&lt;/p&gt;

&lt;p&gt;In the search results you need to look for PHP Debug which is provided by xdebug official group and it has a tick mark lable on it, click on the install button provided in the bottom right of the menu item.&lt;/p&gt;

&lt;p&gt;Once installed you are done with the setup 1.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 : Enable Xdebug in your lando.yml file.
&lt;/h2&gt;

&lt;p&gt;Lando’s Drupal images for all version comes pre-installed with xdebug but it is disabled by default. So you need to specify this in the lando.yml file of your application/development enviornemnt.&lt;/p&gt;

&lt;p&gt;You can do so by adding &lt;code&gt;xdebug: debug&lt;/code&gt; to the appservice and then rebuild your lando instance.&lt;/p&gt;

&lt;p&gt;here is an example lando.yml which has xdebug enabled.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;File path :project-root/lando.yml&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: acms-dev-portal
recipe: acquia
config:
  webroot: docroot
  xdebug: debug
  php: '8.0'
services:
  phpmyadmin:
    type: phpmyadmin
  appserver:
    xdebug: debug
    config:
      php: .lando/php.ini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above file there are two things you should give attention to&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;php: .lando/php.ini&lt;/em&gt;, We are passing a custom php.ini file, this file will hold the configuration for xdebug php configurations.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;xdebug: debug&lt;/em&gt;, we are enabling xdebug by setting the key &lt;em&gt;xdebug&lt;/em&gt; to &lt;em&gt;debug&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 3 : Create and configure custom php.ini file for lando.yml .
&lt;/h2&gt;

&lt;p&gt;We need to add some configurations to enable and connect php with xdebug, as we are running php in a lando container we need to extend the php.ini settings inside the lando container. Hence to add this custom settings to the lando php.ini we need to create a php.ini file in the project root and then pass the path to this php.ini file to lando.yml as mentioned in Step 2.&lt;/p&gt;

&lt;p&gt;You can actually create this file at any location in your project root directory, just make sure you update the your .lando.yml accordingly.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;Filename: .lando/php.ini&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[PHP]
xdebug.max_nesting_level = 256
xdebug.show_exception_trace = 0
xdebug.collect_params = 0
xdebug.mode = debug
xdebug.client_host = ${LANDO_HOST_IP}
xdebug.client_port = 9003
xdebug.start_with_request = yes
xdebug.log = /tmp/xdebug.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here if you check the above configs we are&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;xdebug.client.host is set to lando containers ip address.&lt;/li&gt;
&lt;li&gt;xdebug.client.port is set to port number 9003. (Note: All latest lando containers use xdebug 3 hence the default port on which xdebug 3 runs is 9003 earlier versions of xdebug uses port number 9000)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 4 : Configure VS Code to run debugger and connect to the lando xdebug environment.
&lt;/h2&gt;

&lt;p&gt;In you project root create a &lt;code&gt;.vscode&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;In this new directory create a &lt;code&gt;lauch.json&lt;/code&gt; file. The path should look like &lt;code&gt;project_root/.vscode/launch.json&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Filename: project_root/.vscode/launch.json&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "port": 9003,
            "log": true,
            "pathMappings": {
                "/app/": "${workspaceFolder}/",
            },
            "xdebugSettings": {
                "show_hidden": 1
            }
        }
    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;All the above configurations should get you up and running with xdebug enjoy debugging and resolving bugs 🐛&lt;/p&gt;

&lt;h2&gt;
  
  
  Attributions
&lt;/h2&gt;

&lt;p&gt;The above article was written reffering the below resources and we woulld like to give a special thanks all mentioned below.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/MatthieuScarset/0c3860def9ff1f0b84e32f618c740655"&gt;Matthieu Scarset for providing the gist.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vladiiancu.com/post/configure-xdebug-3-and-vscode-with-docker/"&gt;Valdi Iancu for putting an great article.&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>What is drupal?</title>
      <dc:creator>Tejas Shah</dc:creator>
      <pubDate>Sun, 09 Apr 2023 08:50:44 +0000</pubDate>
      <link>https://dev.to/thehigglerscompany/what-is-drupal-4ipj</link>
      <guid>https://dev.to/thehigglerscompany/what-is-drupal-4ipj</guid>
      <description>&lt;p&gt;Drupal is an open source content management system developed on php language and mysql database. It is widely used by large organisations as a their Digital Exprience Platform (DXP). Drupal out of the box comes with a lot of content management abilities like&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. User Management with a custimisable RBAC (Role Based Access Control):&lt;/strong&gt; Drupal comes with an highly customisable user management system which can help you create dyanmic websites providing role based access control to the users. With this kind of user management system access to the different parts &amp;amp; features of the website can be controlled to a granular level.&lt;/p&gt;

&lt;p&gt;This is a best fit but not limited to websites run by large enterprise scale Media houses, Insurance companies, Education Institutes &amp;amp; Universities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Customisable content types system:&lt;/strong&gt; Drupal also comes with a composable content architecture where in you can create different kind of content with a set of fields like Text, Body, Date, Taxonomy, Related contents (Entity reference fields) attached to a particular instance, hence this is the only CMS that do not defines how your content should look like, it gives the freedom to the user to create there own content types like Blogs, Page, Contact-form, Books, Movies, User profile’s etc with each one have its own set of fields and yes theorictially there is not limit to how many content types you can create but freedom always comes with responsibility hence there can be a practical limit on how may content types should be created to run your website in optimised manner.&lt;/p&gt;

&lt;p&gt;Drupal content management system also comes with a entity relation fields which helpes you relate one content from with another content form which can be done using a entity reference field.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Media management:&lt;/strong&gt; Drupal also comes with a media library for managing all kind of static assets like images &amp;amp; files and there are Drupal Profiles where in Drupal is modelled as a DAM (Digital Asset Management) Tool as well and this is possible just because of its Media Library Capablities.&lt;/p&gt;

&lt;p&gt;Drupal comes with an media field which can be used to attach the media library to content types so that user can add files and images to the content using a Media field. Another best part of this field is you can define which formats should be supported, what is the maximum file size should and should it be a public or a private file.&lt;/p&gt;

&lt;p&gt;Secondly using contrib module this media library can be extended to use CDN’s and files storages like AWS S3 Buckets etc with Drupal.&lt;/p&gt;

&lt;p&gt;Hence in all Drupal does comes with a full fledge media management system out of the box.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Content moderation system:&lt;/strong&gt; For any content management system a must have is the content moderation and workflow feature so that the content goes through a review process before its published and made live to public. And Drupal does have it out of the box and this is also totally configurable so users can define their own workflow as per their needs and this can then be attached to different content types so you have the freedom to have multiworkflows based on the department, teams, or content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Layout builder and blocks system:&lt;/strong&gt; In the era of drag and drop ui builders, it is vital to have a drag and drop page building capabilties in CMS now a days and it is considered one of the major factor while ranking CMS’s and how can drupal be behind in this race, Drupal also shops with a layout building capability which is also highly configurable to have layouts at content types level or at an each content level (i.e You can have a different layout for each page on the page content type which is usaully needed for creating landing pages.)&lt;/p&gt;

&lt;p&gt;Hence Drupal does scores good when it comes to having a page building capability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Views - A UI based query builder:&lt;/strong&gt; Drupal comes with a very unique feature named views which as far as I know I havent yet seen any other CMS has something similar or even nearby to what views has to offer.&lt;/p&gt;

&lt;p&gt;Views is a visual query builder hence using views you can query the content from the Drupal DB and show it in mutliple form like page, blocks, attachments, etc.&lt;/p&gt;

&lt;p&gt;Views also gives you an option to create exposed filters and even contextual filters (i.e url or other context based filters.)&lt;/p&gt;

&lt;p&gt;I must say with views sky is the limit to query data and create displays.&lt;/p&gt;

&lt;p&gt;Conclusion: Hence, this feature of content archtecting helps in creating a wide variety of application using Drupal hence not restricting its usage only to creating a personal blogging website indeed you can create a wide variety of software application using Drupal outof the box and hence it is mostly also termed as Content Management Framework. Drupal in its core is designed and architured in such a way that it can perfect be called as a low code platform which recently is a kind of BUZZ word in the industry.&lt;/p&gt;

</description>
      <category>drupal</category>
    </item>
    <item>
      <title>How to create a custom token for Drupal</title>
      <dc:creator>Tejas Shah</dc:creator>
      <pubDate>Mon, 20 Mar 2023 20:53:47 +0000</pubDate>
      <link>https://dev.to/thehigglerscompany/how-to-create-a-custom-token-for-drupal-4c2l</link>
      <guid>https://dev.to/thehigglerscompany/how-to-create-a-custom-token-for-drupal-4c2l</guid>
      <description>&lt;h2&gt;
  
  
  How to create a custom token for tokens module in Drupal 10
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;It’s possible that you’ll frequently need to extract particular values or patterns from Drupal’s entity systems when developing a Drupal 10 site. For instance, if you have a special email that has to be sent to a user for a certain occasion, you might want to include the user’s name, the name of the blog, and the date it was published. You need details like the login, blog title, and published date to be utilised in the email message template setup form in order to do this. Tokens may be used to represent these data in the email template thanks to Drupal’s Token system, which is where it comes into action.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;Tokens, how they work : Every token consists of a text string in a particular pattern as [token-type:replacement-string] this string is composed of two parts one before the ”:” (semicolon) called as &lt;strong&gt;token type&lt;/strong&gt; and second part comes after the ”:” (semicoloon) called &lt;strong&gt;replacement string&lt;/strong&gt; described as below:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Token Type:&lt;/strong&gt; Token type is basically used to group related tokens together for eg: [node:title], [node:created_date] etc here you can see are the token related to node are grouped together, other example would be a custom/contrib module declaring custom token would group there token in the name of the module like [module-name:title].&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Replacement String:&lt;/strong&gt; The second part which is called replacement string is a part with acts as a variable and gets replaced with the process value as processed in hook_token().&lt;/p&gt;

&lt;p&gt;Below we will have a look at what is a procedure to create our custom tokens.&lt;/p&gt;

&lt;h2&gt;
  
  
  Procedure to define a custom token
&lt;/h2&gt;

&lt;p&gt;Here we will create a custom token for replacing the page title with an short and SEO optimised title if available else use the page title as it is. This will be used in Drupal Metatags module to dynamically update the post title in browser and SEO.&lt;/p&gt;

&lt;p&gt;We have a title field in each content types we create in Drupal, this is the main title field used by the author for an article which usually is a very long string. It is recommended that the lenght of the meta title which is used for SEO should be not more than 60 character hence we add a new field named as &lt;em&gt;Short Title&lt;/em&gt; which author can add for SEO purpose and our token will conditionally check if the short title is available then it will use the short title to add to meta tag else it will default back the main title field.&lt;/p&gt;

&lt;p&gt;Below lets see how to create if custom token in practicle.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1
&lt;/h3&gt;

&lt;p&gt;Create a custom module or if you already have one you can use the same, in the custom module create a file with the name as shown below&lt;/p&gt;

&lt;p&gt;&lt;code&gt;moduleName.tokens.inc&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2 : Define hook_token_info() in the file create in step 1.
&lt;/h3&gt;

&lt;p&gt;In this file define a php function/hook function named hook_token_info() this hook takes two parameters as below&lt;/p&gt;

&lt;p&gt;Return Values: This hooks returns an associative array with two elements &lt;em&gt;types&lt;/em&gt; and &lt;em&gt;tokens&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In our example we define a hook as below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/**
* Implements hook_token_info().
*/
function module_name_token_info() {
    $info = [];
    $info['types']['module_name'] = [
      'name' =&amp;gt; t('Condtional Short Title'),
      'description' =&amp;gt; t('Tokens for using short title if available else default to normal title in seo meta tags.'),
    ];
    $info['tokens']['module_name']['seoShortTitle'] = [
      'name' =&amp;gt; t("Seo short title."),
      'description' =&amp;gt; t('Seo optimised short title.'),
    ];
    return $info;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code implements a type named “Conditional Short Title” and a token under this type(group) named “seoShortTitle”.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3 : Define hook_tokens() in the file create in step 1.
&lt;/h3&gt;

&lt;p&gt;This hook provides a replacement text for any token in the group that your module knows how to process.&lt;/p&gt;

&lt;p&gt;This hook take the below parameters:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$type:&lt;/strong&gt; The machine-readable name of the type (group) of token being replaced, such as ‘node’, ‘user’, or another type defined by a hook_token_info() implementation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$tokens:&lt;/strong&gt; An array of tokens to be replaced. The keys are the machine-readable token names, and the values are the raw [type:token] strings that appeared in the original text.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;array $data:&lt;/strong&gt; An associative array of data objects to be used when generating replacement values, as supplied in the $data parameter to \Drupal\Core\Utility\Token::replace().&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;array $options:&lt;/strong&gt; An associative array of options for token replacement; see \Drupal\Core\Utility\Token::replace() for possible values.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;bubbleable_metadata:&lt;/strong&gt; The bubbleable metadata. Prior to invoking this hook, \Drupal\Core\Utility\Token::generate() collects metadata for all of the data objects in $data. For any data sources not in $data, but that are used by the token replacement logic, such as global configuration (e.g., ‘system.site’) and related objects (e.g., $node-&amp;gt;getOwner()), implementations of this hook must add the corresponding metadata.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Return value&lt;/strong&gt; array An associative array of replacement values, keyed by the raw [type:token] strings from the original text. The returned values must be either plain text strings, or an object implementing MarkupInterface if they are HTML-formatted.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/**
* Implements hook_tokens().
*/
function module_name_tokens($type, $tokens, array $data, array $options, $bubbleable_metadata) {
  $replacements = [];
  if ($type == 'module_name' &amp;amp;&amp;amp; !empty($data['node'])) {
      foreach ($tokens as $name =&amp;gt; $original) {
          switch ($name) {
              case 'seoShortTitle':
                $node = $data['node'];
                if ($node-&amp;gt;hasField('field_short_title') &amp;amp;&amp;amp; !$node-&amp;gt;get('field_short_title')-&amp;gt;isEmpty()) {
                    $text = $node-&amp;gt;field_short_title-&amp;gt;value;
                    $replacements[$original] = $text;
                  }
                  $replacements[$original] = $text ?? $node-&amp;gt;getTitle();
              break;
          }
      }
  }
  return $replacements;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The below image shows the implementation of our example used in the above post.&lt;/p&gt;

&lt;p&gt;Hence the above two hooks are used to define a custom token in drupal.&lt;/p&gt;

</description>
      <category>drupal</category>
    </item>
    <item>
      <title>Using Frontmatter CMS with Astrojs Static Site</title>
      <dc:creator>Tejas Shah</dc:creator>
      <pubDate>Fri, 17 Mar 2023 11:48:17 +0000</pubDate>
      <link>https://dev.to/thehigglerscompany/using-frontmatter-cms-with-astrojs-static-site-2a0n</link>
      <guid>https://dev.to/thehigglerscompany/using-frontmatter-cms-with-astrojs-static-site-2a0n</guid>
      <description>&lt;p&gt;Recently I was looking for better was to manage the markdown files of for my static blog website and I didnt want to leave behind editor interface just to write a new blog article as I am too lazy to switch between multiple interfaces. Hence while I was searching on the google if any such simple products exsist which looks a CMS.&lt;/p&gt;

&lt;p&gt;The IDE i use for my development purpose is VS code hence I thought to search if there is any vscode based solution and as always we think it and VSCode extension is available for the same and I got to know about Frontmatter CMS, which is a CMS right in your code editor as per there website and this looked to be interesting to me hence I thought of exploring the same with my Astrojs based static blog.&lt;/p&gt;

&lt;p&gt;Below are my observation about using Frontmatter CMS with Astro js static in VScode is as below:&lt;/p&gt;

&lt;p&gt;Here I will first ldown what I was actually looking for and see if frontmatter cms satisfies my needs…&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What I was looking for is an dashboard kind of interfacew listing blog post?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Yes, Frontmatter CMS once configured provides a nice grid interface listing all the blogs post, it also provides and option to “Create” “Deleted” &amp;amp; “Update” the articles below image shpows how the interface looks like.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A nice markdown editor for creating, editing and updating articles ?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is where I found Frontmatter CMS needs to improve as in the current interface it provides if we try to edit any article it just open a file in vs code which as a claimed CMS should have a proper wisysig editor like Quilljs or editorjs etc.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I wanted some frontmatter to be auto populated like published date, last modified date etc..?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Yes, FrontMatter CMS provide this as a feature, I havent yet tried but wanted this feauture for other frontmatters like UUID etc, but I am sure there might be an api to create either a custom field for such custom requirements.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Nice interface to select list of tags/categories alsready used in other posts so that duplicated with spelling changes can be avoided like blog &amp;amp; blogs?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Yes, Frontmatter CMS provides a nice interface with select list type of fields and also prepopulates the tags used in all the posts this is done using a content type defination in frontmatter.json file&lt;/p&gt;

&lt;p&gt;I am still exploring new features and how it can be used as a CMS in IDE and will keep updateing thos post so that others can also leverage this awesome in IDE CMS for static sites.&lt;/p&gt;

&lt;p&gt;You can find more about &lt;a href="https://frontmatter.codes/"&gt;Frontmatter CMS&lt;/a&gt; on there official &lt;a href="https://frontmatter.codes/"&gt;Website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>astrojs</category>
      <category>frontmattercms</category>
    </item>
    <item>
      <title>DrupalCon Lille 2023 Call for Papers Now Open.</title>
      <dc:creator>Tejas Shah</dc:creator>
      <pubDate>Wed, 15 Mar 2023 00:37:17 +0000</pubDate>
      <link>https://dev.to/thehigglerscompany/drupalcon-lille-2023-call-for-papers-now-open-37ak</link>
      <guid>https://dev.to/thehigglerscompany/drupalcon-lille-2023-call-for-papers-now-open-37ak</guid>
      <description>&lt;p&gt;The Drupal community is gearing up for DrupalCon Lille 2023, which will take place in the charming city of Lille, France, from August 23-27, 2023. DrupalCon is the premier event for Drupal enthusiasts, and this year’s conference promises to be an exceptional one. The organizers have announced that the call for papers is now open, and they’re inviting submissions from the community.&lt;/p&gt;

&lt;p&gt;DrupalCon Lille is an excellent opportunity to share your expertise, knowledge, and experience with other Drupal enthusiasts. The conference brings together developers, designers, project managers, and business leaders from around the world to learn, network, and collaborate. As a speaker, you’ll have the opportunity to share your insights and ideas with a captive audience, and contribute to the advancement of the Drupal community.&lt;/p&gt;

&lt;p&gt;The organizers are looking for presentations on a wide range of topics related to Drupal development, design, and business. The following are some of the suggested topics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Site building and development&lt;/li&gt;
&lt;li&gt;Front-end development&lt;/li&gt;
&lt;li&gt;Back-end development&lt;/li&gt;
&lt;li&gt;DevOps and infrastructure&lt;/li&gt;
&lt;li&gt;DevOps and infrastructure&lt;/li&gt;
&lt;li&gt;Business strategy and marketing&lt;/li&gt;
&lt;li&gt;Project management&lt;/li&gt;
&lt;li&gt;Case studies and success stories&lt;/li&gt;
&lt;li&gt;Community and culture&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The organizers of DrupalCon Lille welcome proposals from Drupal enthusiasts of all skill levels and backgrounds. If you have a great idea for a presentation, don’t wait too long to submit it. The deadline for session submissions is April 24, 2023, at 23:59 CET (Lille Time). Please note that the organizers have announced that there will be no deadline extensions this year, so it’s important to submit your proposal as soon as possible. &lt;a href="https://kuonicongress.eventsair.com/PresentationPortal/Account/Login?ReturnUrl=%2FPresentationPortal%2Fdrupalcon-lille-2023%2Fsession-portal"&gt;Session Submission Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Submitting a proposal is easy. Simply visit this &lt;a href="https://kuonicongress.eventsair.com/PresentationPortal/Account/Login?ReturnUrl=%2FPresentationPortal%2Fdrupalcon-lille-2023%2Fsession-portal"&gt;website&lt;/a&gt; create your account and login and there on-wards follow the online submission form. You’ll need to provide some basic information about yourself, your proposed session, and your speaking experience. The deadline for submissions is April 24, 2023, so be sure to get your proposal in on time.&lt;/p&gt;

&lt;p&gt;In conclusion, DrupalCon Lille is an excellent opportunity to share your expertise and learn from other Drupal enthusiasts. If you’re passionate about Drupal development, design, or business, consider submitting a proposal for DrupalCon Lille 2023. Who knows? You might just end up inspiring someone else in the community.&lt;/p&gt;

</description>
      <category>drupal</category>
    </item>
    <item>
      <title>Drupal 10 development environment setup using lando..</title>
      <dc:creator>Tejas Shah</dc:creator>
      <pubDate>Wed, 01 Mar 2023 02:43:59 +0000</pubDate>
      <link>https://dev.to/thehigglerscompany/drupal-10-development-environment-setup-using-lando-2p3p</link>
      <guid>https://dev.to/thehigglerscompany/drupal-10-development-environment-setup-using-lando-2p3p</guid>
      <description>&lt;p&gt;Drupal 8 onwards it is preety much clear that Drupal has adopted the standard php development practises and this is followed by all the latest release of Drupal like Drupal 9 and Drupal 10.&lt;/p&gt;

&lt;p&gt;Hence by now it should be understood that to use Drupal, drupal developers needs to know few tools and technologies to smoothly carry out their drupal development task/projects. This new addition of tools does add a little extra effort initially to learn, but I am sure later this is going to make your life so so easy when it comes to major version upgrades, module installation and upgrades etc…&lt;/p&gt;

&lt;p&gt;Hence here in this article we are going to talk about this tools and how we can use them from installing Drupal to start customising drupal with custom module, theme developments.&lt;/p&gt;

&lt;p&gt;So lets start with the list of tools needed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Composer 2.0 and above&lt;/li&gt;
&lt;li&gt;Drush 11 and above&lt;/li&gt;
&lt;li&gt;Lando (Lando works on docker and hence docker needs to be installed in you computer, the instruction on how to install docker is out of the scope of this article.)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Below is the steps you needs to follow to start with the setup.
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Installing lando
&lt;/h3&gt;

&lt;p&gt;Based on the operating system you are using this steps to install lando differs a little bit, in this article we are considering Linux debian based OS to show lando installations steps&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Run below command to update and upgrade your local linux packages:

sudo apt update 

sudo apt upgrade


The download lando's debian installer package from the link given below
wget https://files.lando.dev/installer/lando-x64-stable.deb

Then install lando from the downloaded package in the last step

sudo dpkg -i lando-x64-stable.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the above step complete lando should be installed and you can verify this by the below command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lando version
(The above command should give you the installed lando version as the output as shown below.)

Output:
v3.11.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this you have installed lando installed on your computer, lets move on to the next setup of installing composer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Installation of php package manager Composer 2.0
&lt;/h3&gt;

&lt;p&gt;Composer is a php package management tool,it helps in installing and managing php dependencies. Composer can be installed in two ways on linux, it can be installed globally or it can be installed for a specific project, both ways would work just that if its installed globally you can run composer in any directory with just “composer” key work in terminal, and if composer installed locally to any project you will have to you it by providing path the composer.phar file.&lt;/p&gt;

&lt;p&gt;We can install composer using linux aptitude repository with the below command. Weare going to use global method of composer in this article.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install composer 

Once this execution of the above command finishes you can verify if the composer is installed and running successfully by below command 

composer --version

If the above command output's the verison number then it confirms you have installed composer successfully.

outpur:
Composer version 2.4.4 2022-10-27 14:39:29

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Installation of Drupal 10 using composer
&lt;/h3&gt;

&lt;p&gt;To install Drupal 10 using composer we can use create-composer script provided by Drupal at &lt;a href="https://www.drupal.org/project/drupal/releases/10.0.4"&gt;Drupal 10 script link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To Start a new Drupal Project with version 10.0.4:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer create-project drupal/recommended-project:10.0.4 "install-dir"

Here install-dir should be replaced with the name or path where you want to add the codebase.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code will download the Drupal 10.0.4 version in the said path including all the dependencies, but drupal is not yet ready to use, we need to provide a database to the to drupal so that it can store your config’s and data.&lt;/p&gt;

&lt;p&gt;Ah, but we have downloaded or installed any database yet now we have it in the tools needed 🤔, dont worry thats were lando helps us ill explain how, as mentioned above lando is an docker based solution, so all the dependecies like php, php-extensions and the database will be taken care by lando and upon running lando commands we will instruct lando to pullv drupal optimised php docker image and mysql docker image from the docker repo, create a container of this images run some internal docker networking commands, mount the current code base directory to docker container volumen and setup a traefik dns server for us so that we can access our drupal application in the browser and start developing the same.&lt;/p&gt;

&lt;p&gt;But how does all this work, it all happens with .lando.yml file which we will generate now in the next step.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 4: Initialize lando in
&lt;/h4&gt;

&lt;p&gt;So in this step we will use lando to create and manage our docker based development environmentt, follow below steps to intialise lando&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;cd into the project root directory
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd {install directory}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Run below command
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    lando init

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: At this step lando will prompt you to select few options as below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1st Prompt:
    ? From where should we get your app's codebase? (Use arrow keys)
        acquia 
        ❯ current working directory [**Select this option and press enter**]
        github 
        lagoon 
        pantheon 
        platformsh 
        remote git repo or archive 

2nd Prompt:
    ? From where should we get your app's codebase? current working directory
    ? What recipe do you want to use? 
        wordpress 
        acquia 
        backdrop 
        ❯ drupal10 [**Select Drupal 10 option and press enter**]
        drupal6 
        drupal7 
        drupal8 
    (Move up and down to reveal more choices)
(Note: In this prompt navigate the option but clicking down arrow in you terminal)

3rd Prompt:
    Where is your webroot relative to the init destination? (.) &amp;gt; ./web [**Type "./web" as when we create a drupal project using create-project script the docroot is inside web directory of our codebase.**]

4th Prompt:
    ? From where should we get your app's codebase? current working directory
    ? What recipe do you want to use? drupal10
    ? Where is your webroot relative to the init destination? ./web
    ? What do you want to call this app? (My Lando App) SomeNameToYourProject [**Here you can give any name to your project**]

Wallahhh you are all set.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After all the above promts getting answered you should be able to see a new file in your project directory name .lando.yml. This file stores all the configurations we just made by answering the lando prompts.&lt;/p&gt;

&lt;p&gt;(Note: This is a one time process, here onwards you will not have to answer any prompts or follow such a long process.)&lt;/p&gt;

&lt;p&gt;Now to start your lando/docker containers run the below command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Run this command at project root where you can see the .lando.yml file

lando start

(Give some time for lando to download the images and start the containers)

 Output:

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see that after some time and some scrappy letters in the terminal lando has outputed a set of urls and thats it you are all set open this url in the browser and you will see Drupal Installation page.&lt;/p&gt;

&lt;p&gt;For database credentials you can use below credential as every lando Drupal 10 project has it same.&lt;/p&gt;

&lt;p&gt;Database Name: Drupal10&lt;/p&gt;

&lt;p&gt;Database User Name: Drupal10&lt;/p&gt;

&lt;p&gt;Database User Password: Drupal10&lt;/p&gt;

&lt;p&gt;Database host : datatable&lt;/p&gt;

</description>
      <category>drupal</category>
    </item>
    <item>
      <title>Git commands cheatsheets</title>
      <dc:creator>Tejas Shah</dc:creator>
      <pubDate>Tue, 13 Dec 2022 02:42:32 +0000</pubDate>
      <link>https://dev.to/thehigglerscompany/git-commands-cheatsheets-37d3</link>
      <guid>https://dev.to/thehigglerscompany/git-commands-cheatsheets-37d3</guid>
      <description>&lt;h3&gt;
  
  
  Git Reset
&lt;/h3&gt;

&lt;p&gt;Git reset is a command used to revert or undo your commit to a specific commit specified to the command.&lt;/p&gt;

&lt;h6&gt;
  
  
  Command
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Option 1: git reset {commit hash}

(Note: This command is defaulted to --soft)

Option 2: git reset --hard {commit hash}

Option 3: git reset --soft {commit hash}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Git Revert
&lt;/h3&gt;

&lt;p&gt;Git revert basically created a new commit with the changes you want to undo, this helps in maintaining the git histroy.&lt;/p&gt;

&lt;h6&gt;
  
  
  Command
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Option 1: git revert {commit hash}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Git Squash
&lt;/h3&gt;

&lt;p&gt;Git Squash is a terminology and not a command, basically when we want to combined “N” number of continous commits into a single commit we can use squash commits using git rebase.&lt;/p&gt;

&lt;p&gt;To know more on git rebase&lt;/p&gt;

&lt;h6&gt;
  
  
  Command
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Option 1: git revert {commit hash}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Git Rebase
&lt;/h3&gt;

&lt;h6&gt;
  
  
  Command
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Option 1: git rebase {commit hash}

Option 2: git rebase -i {commit hash}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  How to create a branch from a pull request or a merge request
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Overview
&lt;/h4&gt;

&lt;p&gt;You may have came to a situation where in you want to get the code/changes in a particular PR to local environment, but as PR or a MR is not a branch on your repository how can you pull a PR or MR, the below command can be used to pull the code from a PR and create a new branch in your local env.&lt;/p&gt;

&lt;h4&gt;
  
  
  Command
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git fetch origin pull/$ID/head:$BRANCHNAME

For example: git fetch origin pull/2/head:MASTER

Note: Here ID is the PR number for github users and MR number for gitlab users.

git checkout $BRANCHNAME

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>git</category>
    </item>
  </channel>
</rss>
