Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

Code

By editor , 31 October, 2017

Configuration property error.

Tags

  • Drupal 8
  • Code
  • Plugin
  • Configuration

 

If you have an error like this, when you use a custom views filter plugin, the resent is now you need to have a config schema for all Views filter plugins.

The error :

By editor , 13 October, 2017

PHP Tips for easy development

Tags

  • PHP
  • Code

Generate a random key.

$random_key = str_shuffle('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'); // 62 characters
$random_key = substr($random_key, 0, 10); // 10 characters

 

By editor , 18 September, 2017

Use IMCE on custom page

Tags

  • Drupal 8
  • Code
  • Drupal 7
  • Module

Example 1 (for drupal 7)


Step 1. Add file brows

Create a simple js file in your module directory (called yourModuleName.js) and enter the following Javascript.

By editor , 17 September, 2017

Disable cache for a specific page

Tags

  • Drupal 8
  • Code
  • Cache
  • Module

Disable cache for a custom page from route declaration.

If you want to disable cache for a custom controller (Custom module), You have no_cache option (YOUR_MODULE.routing.yml).
Example :
File : mymodule.routing.yml

By editor , 13 September, 2017

Render a Node or an Entity

Tags

  • Drupal 8
  • Code
  • Views
  • Node
  • Field
  • Drupal 9

On drupal 8 every elements (almost) are an entity, as any entity you can render a node.

By editor , 12 September, 2017

Autocomplete function for textfield of Form API

Tags

  • Drupal 8
  • Code
  • Form

First, Create autocomplete controller and the route

Example of the controller : DefaultController.php

<?php

namespace Drupal\mymodule\Controller;

By editor , 28 July, 2017

Change a metatag dynamicly

Tags

  • Drupal 8
  • Code
  • SEO
  • Hook

Add meta tag from controller

Example: Add <meta http-equiv="refresh" content="30">
$data = [
  '#tag' => 'meta',
  '#attributes' => [

By editor , 25 July, 2017

How to create a JSON web service on drupal 8 ?

Tags

  • Drupal 8
  • Code
  • Module
  • WebService

This is a simple example of a web service. For the example, We will make a service to multiply two numbers.

Create JSON WebService module

Create a module.

Here : mywebservice

By editor , 20 July, 2017

Download and Install Composer on Linux

Tags

  • Drupal 8
  • Code

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

Download Composer

Link : https://getcomposer.org/download/

By editor , 7 July, 2017

Git Tags - Git tag usage

Tags

  • Code
  • Git

Tag a branche / Version on git

git tag THE_TAG_NAME

 

Push tags or a tag to origin ripository

git push --tags

 

Show tags list

git tag

Pagination

  • Previous page
  • 4
  • Next page
Code

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer