Drupal

Content displays incorrect breadcrumb and menu information

So, I was asked to look at a Drupal page that for whatever reason, it displayed a Breadcrumb of "Students > Advocacy > Moot Court" and the navigation also was highlighted on this page, although, there was nothing in the aforementioned menu structure that contained this page.

I went into "URL aliases" and deleted the url aliases that contained "moot".  That fixed the problem.

The URL aliases admininstration tool can be found in Home > Site building > URL aliases

Display block if not in a role

Just put together the following snippet that will return false if the user does not have a specific role.

Please note that you will have to include the <?php ?> tags when you add this to your block PHP textarea.


<?php
  global $user;
if (in_array('Admitted Student', array_values($user->roles))) {
  return FALSE;
} else {
  return TRUE;
}
?>

Showing block content based upon page categories

If you are trying to display content in your blocks based upon what categories your page belongs to, head over here.  Good article on how to do this.

 

One thing, the code he used is an image, so here is a text version of it for the argument

Restricting block to specific content type

I needed to configure a block to appear on just a specific content type page.  I did this by configuring the block to evaluate the following PHP:

One note, I changed 'page' to 'pagex' since I wanted to not apply this block to regular pages, but wanted to provide it as a argument placeholder.

Doubling of content in Firefox

I have to document this since I have had come across this 3x so far, each time a week apart so I forget what I did to fix it.  We are using tinymce in drupal, and when the content is rendered in firefox, it will be displayed 10 times. 
The root cause of the problem was that there was an html comment present in the content.  Since the html comment is escaped out (yes, I am using full html), this messes up the page in firefox. 
Removing the html comment fixed it.

Imagecache troubleshooting

 

I am setting up image galleries using the node_gallery module.  However, no images were showing.  The ImageCache module was reporting the following:

Failed generating an image from 2_ugalaw591.jpg using imagecache preset node-gallery-display.

That tells me a lot.  I was actually kind of missing the Grails stack trace (Ha ha!).

 

 

Once I enabled the module "ImageAPI GD2", all was well!

upgrading centos to php 5.2 in 1 minute

Just gave myself the high five.  The default centos yum repositories don't have PHP 5.2, which for a drupal developer is a major handicap. 

 

Step 1, add this guy's repo keys your server.  Yes, I am trusting his stuff.

rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

Step 2, add his repo to your system

vi /etc/yum.repos.d/utterramblings.repo

paste the following code:

walking toward the edge of work safe

I am using the lightbox2 module to display some image galleries in Drupal, and in my search for documentation, found this tutorial.   Heck, with a name like this, even if I don't learn something, it could still have a happy ending!
http://tips.webdesign10.com/how-to-make-a-brazilian-bikini-photo-gallery...

Choosing the right version of the module thoughts

This isn't a specific "what version to use" question for a module, but just something that I thought of as I was installing the lightbox2 module.  The following screenshot show 2 version for Drupal 6.x, there's the official release from Jan 09, and the dev version from August 2009.

When I saw that originally, I though, "Wow, I bet there is a lot of new features and cool things in that new version, like 8 months of development, and that older version is sooo old!"

can't create user when logged in with content_profile

Interesting, confusing issue with the content_profile module.   I was logged in already as an administrator, and when to create a new user in the admin tool.  Completed all the fields, it submitted the form and was redirected to the user list view.  The user that I tried to create was no where to be found.  Nada.  All that data entry for nothing. 

Of course, I rinse, repeat, check the logs, etc... still no user.

Syndicate content