Category archive

Drupal

Explore every article in Drupal, with preserved WordPress-friendly URLs.

7 articles

Drupal

Drupal 8 render block from node twig file

{{ drupal_entity(‘block’, ‘put your block id here’, check_access=false) }} check_access=false => This is to make check if the block is allowed to access by which kind of user; default is false, which allow the block to be displayed without any check.

Feb 23, 2019

Read article

CMS

How to search in specific content type in drupal 7

Suppose you have created a content type named as “testimonial”. Now the requirement is to for search for a value “hello” under field name “title” then you can do so by using the below query. Please make sure that you have the “Entity API” module enabled. $searchkeyword = $_REQUEST[‘keyword’]; $query = new EntityField

Aug 1, 2018

Read article

Drupal

drupal clean URLs not working? with tilde sign

If your site is developed in Drupal and your URL looks like this: If your site URL looks like this: http://[domain name OR IP Address]/~[accountname]/anyFolder/ Example http://example.com/~xyzaccount/somefolder/ http://xxx.xxx.xxx.xxx/~xyzaccount/somefolder/ Then you need to set RewriteBase!in your .htaccess file that

Aug 8, 2015

Read article

CMS

Create template specific to node in drupal 6

If you want to have custom templates for your node. You can create templates specific to node ID as follows. Add the below function in your template.php if its not exists. function yourcurrentthemename_preprocess_node(&$vars, $hook) { $node = $vars[‘node’]; $vars[‘template_file’] = ‘node-‘. $node->nid; } If the functio

Mar 9, 2012

Read article