Getting drush configuration and alias files to work

I have struggled a couple hours with this to post the question on the forum ...

Fresh install of drupal ... everything went very well

Fresh install of drush ... everything went well again

How to logout of drupal with no link

I recently installed drupal and created a user account. Then signed out of admin and logged in with the new user account. The new account does not have anything so there is not even a logout link! So basically I was stuck unable to logout. After much search there was no answer on the web. So when I did find the answer (by logging in using another browser, being too lazy to delete cookies) and looking at the link URL for logout which is http://DRUPAL_SITE_ROOT/user/logout, I decided to post it right away ... I am sure I am not the only one with this issue!

Custom $form_state['redirect'] is not working on Drupal 7?

Hello :)

I am creating a web page. And after submitting the node I need to display a web page saying "Thank you for posting your content!" instead of the node itself.
The task looks simple, but it's not working as I expected. In Drupal 6 I could do

$form['#redirect'] = "somewhere";

but after some gooogling I found out that this was removed in Drupal 7, so now I need to do:

$form_state['redirect'] =  "somewhere";

Unfortunately it did not work - after submitting the node form the node was displayed. I had the fallowing code in my module:

/**
* Implementation of hook_form_alter()
*/
function MY_MODULE_form_alter(&$form, &$form_state, $form_id)
{
    switch($form_id) {
        case 'bylos_node_form':
            $form['#submit'][] = '_MY_MODULE_custom_submit';
            break;
        default:
            break;
    }
}
/**
* Custom submit handler
*/
function _MY_MODULE_custom_submit($form, &$form_state) {
    $form_state['redirect'] = url('thank-you', array('absolute' => true));
}

As I found out that after my custom submit the node_form_submit() (line 404 in node.pages.inc) function is called and after the line

$form_state['redirect'] = 'node/' . $node->nid;

my custom redirect fails.
I could do simpe core hack by replacing the line above with:

PROFILE MODULE does not exist in my modules list.

I have Drupal 7 on my localhost. I use OS XP SP3, WAMP server 2.0 (PHP 5.3.0, Apache 2.2.11).

When I wanted to enable profile module, I found out that there is no profile module on my modules list at all. I went to my C:\wamp\www\drupal\modules if there is profile folder created with default install, and there is one, like it should be. I tryed to reinstall wamp and drupal, I even tryed with PHP 5.2.0 and 5.2.11 and there still was no profile module in my modules list.

On my status reports everything looks OK.

What else could I try?

Adding lightbox without module?

I'm using Drupal 7 and would like to use Lightbox. Since the Lightbox module isn't available yet for Drupal 7 I figured I'd try and add lightbox manually to the pages on which I need it. I added the scripts to the page using the code below.
The scripts are located in /sites/default/files/js, the lightbox css and images are located in my themes css and images folder.
Since it isn't working I'm obviously doing something wrong. What I'm doing wrong isn't obvious to me however.
Is there anyone out there that is willing to point out the rookie mistake(s) I'm making?

D7 Accessing relevant taxonomy terms (in template.php) for a given node.

I posted a question about theming a couple of days ago but I think it may have not been specific enough to gather any answers. Hopefully this is a direct enough question that someone will know the answer.

This is for Drupal 7 and Drupal 6 approaches will not work.

For a custom theme, in template.php, using the function MYTHEME_preprocess_html(), I would like to access the terms that are related to the current node so that I can add them to the $classes_array.

In Drupal 6, I would use the following (Doesn't work in Drupal 7):

  if (isset($vars['node']->taxonomy)) {
    // Add classes based on taxonomy terms
    $taxonomy_classes = array();
    foreach($vars['node']->taxonomy as $term_info) {
      $taxonomy_classes[] = 'taxonomy-'.form_clean_id($term_info->name);
    }
    $vars['body_classes'] .= " ".implode(' ', $taxonomy_classes); // Concatenate with spaces
  }

Does anyone have a clue of how to do this with D7?

Thanks,
Andrew

EDIT: Just adding links to relevant discussions so that this might be helpful to others in the same boat.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x