logo

Blog

22 April

Can't save or submit anything after enable Boost in Drupal 7

Published On: Wed, 04/22/2020 - 22:13

I got the problem. After enabled and configured Boost, I cant change any single setting on the site, nothing gets saved. When hitting "Save" button on node edit form or any other submit form, the page just gets reloaded submit not working.

Solution.

This problem occurs only in the dev-version or Version 1.1. Version 1.0 is working well.

1. First install version 1.0 of the module. Activate that module. Go to admin/config/system/boost/htaccess/generator and take the…

21 April

Custom code to add meta tag in Drupal 7

Published On: Tue, 04/21/2020 - 23:45

In your theme's template.php file, you could add something like **/

/** * Implements hook_preprocess_html */ 
function THEME_NAME_preprocess_html(&$vars) { 
	if (current_path() == 'my/custom/path') { 
		$description = array( 
		'#type' => 'html_tag', 
		'#tag' => 'meta', 
		'#attributes' => array( 'name' => 'description', 'content' => 'here all description goes', )
		 ); 
		 
		 drupal_add_html_head($description, 'description'); 
	} 
 }
 

21 April

Redirect Method in DRUPAL8

Published On: Tue, 04/21/2020 - 23:44

To redirect on node add form or node creation form

$form_state->setRedirectUrl(Url::fromUri('internal:' . '/node/add/business'));

If you want to pass argument with URL

Example:

        $params['query'] = [
            'name' => $name,
            'id' => $id,
        ];
$form_state->setRedirectUrl(Url::fromUri('internal:' . '/node/add/business', $params));

Method to redirect on node id url

$url = Url::fromRoute('…