Adding Images to a Panel

Drupal does a lot of things really well. and some not so. and image display is one of the ones that i really don’t care for. But, i have a couple of hints for simple image display in a panel. This is what I wanted. The logo with the site name is at the top left now without any added stuff. That’s all I wanted was the image. and getting that was harder than i expected. This is what I did:

Image

  • Created a custom content type for images
  • Installed the module Exclude Node Title. this allowed me to display the node without having its title above and to the left. Very annoying. all i want is the image
  • Added content of the type that I created for the image that has an image field. I checked the box for “exclude title…”, which is an option you get after you install the module I mentioned above.
  • I went to the panel page that I want to add the image to. I click “add content” to the first sidebar and then choose Existing Node

existing node

 

adding the image node to panel

I then type the name of the image node that I created before. Autofill will help you with this.

At the Configure Existing Node (as seen below) I had to tweak it a bit to allow the new module to do its job. Somewhat counter-intuitively, you have to check the over ride title here and leave it blank so that the exclude mod can over ride it. That seems a little redundant but it worked for me.

The end result is a nice Panel piece that simply displays an image and nothing else. Because the content type that I created specifies an Image, I can also add alt text and hover info from the content itself. At some point, I’ll also want to make this image link back to a URL the same way it does if it is specified at the theme level.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: