Skip to main content

Welcome to Key2Goal

It's a Tech Blog
hero-image
techoptions-img

Blog Posts

techoptions-img
Drupal 8

Hey,today we will see how we can create the block type twig template for any specific block type in drupal 8 or drupal 9.

Drupal 8/9 provided a block type option which was not in drupal 7, by the benefit of this you can create you with any specific set of fields and render them according to your wish. but question is how if we need to style the block html in our own way without affecting the any other block type, so our style will only and only apply to block template. so follow the below steps to archive this 

techoptions-img
Wordpress

While creating wordpress plugin, often we need javascript to use extend the user experience. In this tutorial let see how we can load javascript in wordpress plugin

we Assume you how to create custom wordpress plugin and on your main plugin php file you need to enqueue external scripts.There are various ways to do that like

techoptions-img
Wordpress

Hey there, This article is based on wordpress theme. Many of us know the wordpress has simple interface and very Useful CMS and easy to understand admin structure. there are plenty of themes and plugin available that helps you to look your website beautiful and useful for your users.

Today I want to tell you about a website where you can generate your own themes in just few seconds, its provides you the basic structure of your theme and then you can customize it according to your wish.

The website is underscores.me

techoptions-img
Android

Hi everyone,

Today we see the common andorid studio error for java/kotlin and its solution.

Error:

The minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module's compileSdkVersion (android-30). Dependency: androidx.core:core-ktx:1.7.0-alpha02. AAR metadata file: C:\Users\mohammad.zeeshan1.gradle\caches\transforms-2\files-2.1\a20beb0771f59a8ddbbb8d416ea06a9d\jetified-core-ktx-1.7.0-alpha02\META-INF\com\android\build\gradle\aar-metadata.properties.

techoptions-img
Drupal 8

Hi, In this page we can see how we can populate the geolocation field programmatically,

On several cases while updating and creating the node we need to add the geolocation field, the problem with the geolocation field we need to enter latitude and longitude both as compare to other field like text field need to enter string simply.

Geolocation field takes the input in form of array with specified key value pair

For updating:

techoptions-img
Drupal

In this page you can see how you can update the password of any user in drupal 8 programmatically

There are several case in which you don't have the database access and also if you don't have email service working on drupal 8 website and if you want to reset the password and then this approach will help.

I assume you know how to create basic custom module in drupal 8. Here I am creating a controller class and write code in public function to execute the code using path.

Firstly Create the routing file and give a path like below:

techoptions-img
PHP

Hey, we can see many website have default images if image is broken, so question is how to detect it using php the image is not found given url or not, in php you can do this by just do simple script using cRUL.

cURL is a library that lets you make HTTP requests in PHP, with the script you can check the http request to access different url.

You can use the below code to use this 

techoptions-img
Command line

 

Timezone of server is just nothing but the computer date time, on which it will perform different automatic task base on cron and other software. In this page you can see how you change your server timezone using command line interface 

Check the current time zone first 

- Use command below to check the current timezone 

timedatectl

output - 

techoptions-img
Drupal

As we all know drupal 7 has some very usefull core feature which can we use to our customization of custom or core configraution, In variable_get and variable_set is also an important function to use small piece of data with create any new table in drupal.

In drupal 8 that function is removed, but some equivalent services are provided by drupal for the developer to use when its required, so let's see how you can use these in this tutorial.

In Drupal 7:

- Variable can set by using :

techoptions-img
Drupal

Briefly in this tutorial you can learn how to create a custom template using hook_theme in drupal 8 for your custom routing.

basically the custom route is handle by controller method or by the form to display, etc so the question is can you create the custom twig template for that or not, so answer is yes. you need to follow the below steps and you are done.

let's start

techoptions-img
Drupal

Hey again, again we are come up with drupal8 useful functional to use.

today we see how we can use db_query in your custom module to fetch the complicate data, avoid the joins and conditions. db_query usually use to fastest way to doing these kind of jobs. let check below how you can use it

As we know drupal8, we need to database connection we need at the class in our custom module but you can add the class inline as well, like this 

techoptions-img
Drupal

Hey, again with new solution with new article, in this article we are going to see how we add node ID class with node type to drupal 8 as like drupal 7 format

{node-type}-node-{node-id}

In drupal 7 above format class displayed on node to differentiate with other nodes, but in drupal 8 by default it was not present so we can achieve this easily using hook_preprocess_html in drupal 8

techoptions-img
PHP

Memcache is very popular open source caching tool use in nowdays, this article is related to how we can use the memcache with PHP, So start

First of all you need to install memcache on your server, you can use this link or other according to your operating system

after installation follow below steps to make it work with php

1) Install php-memcached extension, use following command for linux 

techoptions-img
Command line

Hey, today's we are talking about memcache and its storage accessing tricks or techniques

So if you want to know your installed memcache is working or not, or where the data is stored on server for memcache this article helps you to achieve this for you.

Firstly you need to install Memcache on your server you can use this link for ubuntu.

techoptions-img
Command line

Hi guys,

This article related to telnet terminate session many times we use command line telnet to check and access different service but somehow we want to terminate the telnet session then it will not terminate like other command Ctrl +C.

For this, We need to perform a simple shortcut like below

To Terminate the telnet session on linux 

1. type Ctrl + ] on your keyboard and hit enter, and see "telnet>" command prompt

techoptions-img
Drupal

This tutorial shows you how to render the core login form in our template, or using this you can render any form in your template files according to your customization.

We know the drupal 8 uses the form builder to make the form, there is also getform function that get the form components and renderer servcie will render it.

let see how will you achieve this.

firstly we get the form and 

techoptions-img
Drupal

Hi, We are here today with new interesting tips and tricks about drupal 8 views.

In Drupal 7 we now that if we want any conditional based result we can use "Views PHP" to apply and generate the conditional based result, But How in drupal 8 we use that conditional views results, this tutorials explain it to you.

Let take a example:

Suppose you want to show additional text with Gender field

For that I have created a field List(text) field with 3 option: Male,Female and other

techoptions-img
MySQL

Are you want to log queries in some files to see later what your system performance, in this session you can make it possible is just few commands.

we are using shell to execute this process because it is recommeded and most easiest one with restarting mysql server

so First login into mysql using shell, below command helps you, login using super access user

mysql -u username -p 

Now a shell prompted for password, Enter your password 

techoptions-img
Other

If you want to read email form script you need to allow less secure app as same as Gmail, 

Just Go to the link, after login and allow less secure app at the bottom.

https://login.yahoo.com/account/security

Go to "Generate app password"

yahoo mail

Select appropiate option and hit generate.

techoptions-img
Wordpress

Manually Disable a WordPress Plugin in Just 4 Steps :

  1. Log in to your site via FTP.
  2. Navigate to Wordpress Folder then go to wordpress/wp-content/plugins.
  3. Find your plugin folder from the list that you need to disable.
  4. Rename the Plugin Folder to Disabled the plugin.