Top menu

Add param in URL

In the function below, I will show you how to add a parameter in URL by treating all possible cases : first check whether the parameter is already defined in the URL so that we can just update it if parameter is already defined in the URL, so replace the parameter value, rather than append […]

0

Enable the debug extension in Twig

To enable the debug function in twig. You have to modify the file app/config_dev.yml by adding the code below :

Then in your twig file (ex : test.html.twig) : {% debug %} => Display all variables assigned to the template engine for the view in question {% debug var %} => Displays information about […]

0

Remove additional_settings from node add/edit form

When printing a form in Drupal, it has the right to display an area to define more advanced settings. This useful area when a director and totally useless for visitors (see dangerous): There are certainly several ways to remedy this problem, but I suggest you mine which seems clean, just change the forms no longer […]

0

How to get the URL for an image style derivative

To get the URL of an image after applying a particular style on the original picture, it is very simple just use the function below :

Here is an example to use this function :

So we get in the variable $ picture_path the url of the image on which we apply the […]

0

Concatenate a value when updating mysql field

In this post we will show how update string field by concatenating to it? i need a simple query which update mysql field with its value and some modification for example if field have value (3,4,5) i can add (,6) and this just in case it have value and if its NULL then update the […]

0

How to insert a block into a node or template in Drupal 7

   

$block = module_invoke(‘simplenews’, ‘block_view’, ’24’);

0

How do I redirect a form after has been submitted

   

OR :

       

0

Get drupal installed document root

To get the complete base path where the Drupal site is installed you can use:

On a Ubuntu system you will get something like:

If you only use “base_path()”, you will obtain only:

0

Add attribute to field form

 

 

0

Remove the “grippie” div from textarea

To delete the following div which appears below your texterea

You should add the code below in the form_alter hook

0