How to style nodes under $content

panikyrobot - May 7, 2009 - 03:15

Hi,
I am looking to create an art portfolio site where the front page consists of 200px by 200px thumbnails and each one links to a bigger image and article relating to the image. I've downloaded the excerpt module and play around with it. I've tried styling the individual divs "node-1,node-2...etc." that $content creates, but this method does not work because when I click the thumbnails, the page it links me to would also be style with the .css. As a result both the thumbnail and the linking page would have a 200px by 200px dimension.
Am I going about this the right way?

As you can tell,I am new to Drupal, and I've never used a CMS before. However, I know CSS,HTML and javascript. can anyone recommend any books that will teach me the essentials on creating themes for Drupal?

Here is one approach. Start

nevets - May 7, 2009 - 03:43

Here is one approach.

Start with the Content Construct Kit (CCK) for the content type (title, article, image).

Add the image field (and file field) to handle the image.

Add image cache to handle scaling the image as needed, in this case make a preset for 200px x 200px image.

Add the views module, pick the image field, pick the 200px x 200px format linked to the node.
Set the style to grid.

Thank you for the response,

panikyrobot - May 7, 2009 - 03:47

Thank you for the response, I'll give this a try.

Can't get text to 200px by 200px

panikyrobot - May 14, 2009 - 17:34

Ok. I got the thumbnails to work perfectly! thank you. The problem now is that the description underneath extends past the 200px(width). Is there anyway to make the text field the same width(200px) as the thumbnail?

style it in your theme. Bust

binford2k - May 14, 2009 - 18:00

style it in your theme. Bust open firebug to figure out what selectors to use.

Wouldn't styling the node

panikyrobot - May 14, 2009 - 18:09

Wouldn't styling the node width to 200px effect the full page node it links to?
So the full page would still have a node of 200px?

Look at the name of the view.

binford2k - May 14, 2009 - 18:16

Look at the name of the view. Then use an appropriate selector to style the properties of your node when it's a child of that view.

Done! whoa thanks a lot! much

panikyrobot - May 14, 2009 - 18:22

Done! whoa thanks a lot! much appreciated! A million thanks.

not a problem :-) Good

binford2k - May 14, 2009 - 18:37

not a problem :-) Good luck.

Another trick I sometimes use is to add a class to the body, eg:

<body<?php if($is_front) print ' class="front"'; ?>>

 
 

Drupal is a registered trademark of Dries Buytaert.