Tag Archives: Drupal Answers

How do I include custom CSS files in the styles dropdown?

I am trying to include custom css file to ckeditor. It doesn’t show css file in styles drop-down list. I have included this two lines of code into; /drupal/sites/all/modules/ckeditor/ckeditor.config.js config.extraPlugins = ‘stylesheetparser’; config.contentsCss = ‘test.css’; Thanks a lot for the help.

Solution to migrate a field collection

My requirement is to migrate content nodes in xml format to drupal 7 content type fields.The xml contains a node which has to be field collection in drupal.I know how to migrate field which are enity references and term references.But i am new to field collection migration.I am using drupal migrate contrib module for migration.… Read More »

Problem with mixing php code and HTML

when the user is not logged in, I want to redirect the error_page to login in page. I referred to : https://www.drupal.org/forum/support/post-installation/2006-04-22/how-do-i-redirect-anonymous-users-to-a-login-page#comment-126045 and modified my error_page. I added php code to redirect the anonymous user to login page. The page already had only HTML code. After I added my php code, the HTML part is… Read More »

How to send mail using drupal_mail function in custom module?

Am using drupal 6 site and building a custom module,have to send mail after form submission function mailform_mail($key, &$message, $params) { $headers = array( ‘MIME-Version’ => ‘1.0’, ‘Content-Type’ => ‘text/html; charset=UTF-8; format=flowed’, ‘Content-Transfer-Encoding’ => ‘8Bit’, ‘X-Mailer’ => ‘Drupal’ ); foreach ($headers as $key => $value) { $message[‘headers’][$key] = $value; } $message[‘subject’] = $params[‘subject’]; $message[‘body’] =… Read More »

How set node access for guest?

for example I have a url like: /node/add/feature when I go there as guest, I get ‘access denied’, the access should be changed in the code or in the admin panel? but how can I find the exact place where to make changes by following this url?

How do I redirect users and show a message?

I want to redirect users with RedirectResponse and display a message, but the message is not displayed. $response = new RedirectResponse($url); $response->send(); After little debugging I found that my initial (source) URL is loaded twice, and the messages (added with drupal_set_message()) are removed from the session in drupal_get_messages(). So I have no messages on my… Read More »