Node API hooks (hook_node_presave, hook_node_insert, etc.) don’t work with contents created using REST (POST). Is there another way to work on nodes created using REST?Read more
Node API hooks (hook_node_presave, hook_node_insert, etc.) don’t work with contents created using REST (POST). Is there another way to work on nodes created using REST?Read more
I installed Drupal 7 manually and later installed Drush 5. That works fine. When I use command drush config it shows the path to my site. Now I have installed a second instance of Drupal 7 in another site location. How do I change the drush installation to point to the new site rather thanRead more
Can you display pages showing content tagged with term A OR term B in Drupal 7? You used to be able to do it as: /www.example.com/[taxonomy]/term/1+2 Better yet, can you isplay this using ‘friendly names’, e.g. /www.example.com/[taxonomy]/taga+tagbRead more
I want to load users with profile2 fields as a custom function like: function mytheme_getCandidatesHome() { $ type = ‘candidata’; $ users = db_select(‘users’, ‘u’) ->fields(‘u’, array(‘uid’)) ->range(0,8) ->orderRandom() ->execute() ->fetchAll(); $ str = ‘<!–<ul id=”carousel_inner”>–><ul>’; foreach($ users as $ u) { $ profile_data = profile2_load_by_user($ u->uid, $ type); $ str.= ‘<li class=”mmmd-candidate-item”>’; $ str.=Read more
I’m trying to display the format and size of a file attached to an article. Its system name is field_file. So far, I’ve succeeded to load an article in my my_theme.theme file and the field_file field attached to it: $ article = Node::load($ article_nid); $ variables[‘file’] = $ article->get(‘field_file’); then use its uri in aRead more
New to Drupal (using drupal 8) .. please bear with me.. I ‘ve tried to find an answer, but I couldn’t… I have created a content type, say ‘course’ that holds info about a particular course. I have successfully created and placed a twig template, node–course.html.twig and through there I can control the layout ofRead more
I need to add some custom markup inside the first list-item of the main-menu as you can see here: <div id=”block-system-main-menu”> <div class=”block-inner clearfix”> <div class=”content clearfix”> <ul class=”menu”> <li class=”first leaf”><a href=”/de/t1″>Item 1</a> <div class=”my-custom-markup> … … </div> </li> <li class=”leaf”><a href=”/de/t2″>Item 2</a></li> <li class=”last leaf”><a href=”/de/t3″>Item 2</a></li> </ul> </div> </div> </div> With theRead more
use Drupal commerce 2 in Drupal 8 i will change add to cart button to purchase button and users after click purchase go to checkout and pay. how to change add to cart button and disable cart?Read more
I’m using the flag module to allow users to flag (like) each other. I would like to display a view that show the matches, i.e. for a given user I would like to display the users he flagged AND that also flagged him. In sql i would use sth. like: SELECT … FROM {flagging} flaggingRead more
I recently tried to apply some pending update on my website. The website throws following error while updating ctools module- The following updates returned messages ctools module Update #7002 Failed: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes: ALTER TABLE {ctools_object_cache} CHANGE `name` `name`Read more