Drupal 7 Change Content Type of Existing Node
For those looking, this module will do it: drupal.org/project/node_convert
For those looking, this module will do it: drupal.org/project/node_convert
module_load_include(‘inc’, ‘node’, ‘node.pages’); $form = node_add(‘nodetype’); $output = drupal_render($form); If your node form has a file upload widget, you should add the following lines to the menu array: ‘file path’ => drupal_get_path(‘module’, ‘node’), ‘file’ => ‘node.pages.inc’,
From the Drupal 7 upgrade guide: Javascript should be made compatible with other libraries than jQuery by adding a small wrapper around your existing code: (function ($) { // Original JavaScript code. })(jQuery); The $ global will no longer refer to the jquery object. However, with this construction, the local variable $ will refer to … Read more
Try to use “vh or vw” if you need manipulation with browser size. Try to use “background-size: 100%;” on 100% pass needed value. On drupal if you are using module for output different menus and using different templates double check your conditions. Try to check your @media query’s in css on width size for this … Read more
In your theme’s template.php file use the preprocess_html hook: function mytheme_preprocess_html(&$vars) { $vars[‘classes_array’][] = ‘new-class’; } Remember to clear the caches once you’ve implemented the hook or Drupal won’t pick it up.
D7: <?php $block = module_invoke(‘module_name’, ‘block_view’, ‘block_delta’); print render($block[‘content’]); ?> ‘module_name’ = The machine name of the module (i.e. the module’s folder name). This is true for core modules too, so for instance ‘search’, ‘user’ and ‘comment’ would all work here. ‘block_delta’ = The machine name of the block. You can determine what this is … Read more
Here is an example code using which you can use with node_save $filepath = drupal_realpath(‘misc/druplicon.png’); // Create managed File object and associate with Image field. $file = (object) array( ‘uid’ => 1, ‘uri’ => $filepath, ‘filemime’ => file_get_mimetype($filepath), ‘status’ => 1, ); // We save the file to the root of the files directory. $file … Read more
To view entries in Drupal’s own internal log system (the watchdog database table), go to http://example.com/admin/reports/dblog. These can include Drupal-specific errors as well as general PHP or MySQL errors that have been thrown. Use the watchdog() function to add an entry to this log from your own custom module. When Drupal bootstraps it uses the … Read more
You can do this using #markup: $form[‘some_text’] = array( ‘#markup’ => ‘<p>Some text</p>’ );