drupal

Remove WYSIWYG From Individual Node Edit Forms

Sometimes you have a particular node edit form that you DO NOT way the WYSIWYG editor to appear on. Just drop the following into your site specific custom module.

/*
* remove tinymce wysiwyg from individual textareas.
*/
function utility_form_alter(&$form, &$form_state, $form_id) {
  // get the current url
  $req = request_uri();
  switch ($req) {
    case '/node/25/edit':
      $form['body_field']['format'] = array();
    break;
  }
}

Drupal Running Slow on Localhost?

Recently I had a development site set up on my local machine but the site was running so slow that it was actually painful to work with. After a bit of research I found this comment - http://drupal.org/node/348202#comment-2531300

I created a file named convert.php and dropped the following into it:

<?php
// your connection
mysql_connect("localhost","db_username","db_password");
mysql_select_db("db_name");

// convert code
$res = mysql_query("SHOW TABLES");
while ($row = mysql_fetch_array($res))
{
foreach ($row as $key => $table)
{

Remove The 'Add New Comment' From Teasers

Here is a quick way to remove the 'Add new comment' link from teaser views. Put the following into your custom, site specific module.

All About Floats

Everything you need to know about floats and clears by Chris Coyier at css-tricks.com

Easily Embed Twitter Data in Your Site

I found an easy way to embed twitter data in your theme or in a custom block. Download and install the Twitter Pull module. Then all you have to do is something like the following;

<?php
$twitkey
= "Drupal";
$my_title = "Drupal Tweets";
print
twitter_pull_render ($twitkey, $title = $my_title, $num_items = NULL, $themekey = NULL);
?>

You can get more info at the project page but as you can see, it's pretty straight forward and easy.

Syndicate content

Contact Me

Feel free to contact me.

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.