What is the best way to add an area where an image can be displayed in a custom content type.

OR

Is there a way to add a WYSIWYG with image resize automatically? If so what WYSIWYG would you recommend.

Comments

Anonymous’s picture

You should look at the imagefield module...

http://drupal.org/project/imagefield

-Mike Goodwin
http://www.not2us.net
http://www.redleafmedia.com

stephtek’s picture

I attempted that but without any Views 2 Drupal 6 documentation or a walkthrough of how to do it I couldn't figure it out! Has anyone done this that might be able to give me a basic tutorial??? It would be super appreciated!

Jeff Burnz’s picture

You dont need Views, views has nothing to do with this.

You'll want 3 modules however:

Imagecache
Imagefield
Filefield

Install all modules, configure some Imagecache presets, then add an Imagefield to your content type, and be sure to set the Display settings to show the right imagecache preset (you can have many different preset sizes set in Imagecache).

You can also use Lightbox2 to build a simple gallery in each node or show a large version of the image when its clicked.

Need help with IE?
Learn basic XHTML and CSS first.
Get smart with web specs.

stephtek’s picture

OK I have done all this. Is there a way to insert these images into my post now?

Jeff Burnz’s picture

Is the Upload Image field appearing in the node form (when you create or edit a node, do you see a field/buttom where you can upload an image)?

Try to give more information about what you have done, what happens when you try to upload an image, what theme you are using etc etc. At the moment we are "running blind" and have to guess what might be wrong.

stephtek’s picture

I am getting the upload image field in the mode form. And am able to upload an image... when i publish that node the image does not appear. I can email someone some screen captures of my configuration if they are willing to help?

Maybe I am overcomplicating things? I just want images to be able to be posted into my blog entries in a Custom Content Type blog format.

Jeff Burnz’s picture

stephtek’s picture

I am using a custom theme I developed. Lol, that makes things more difficult.

Jeff Burnz’s picture

are you printing the $content variable in node.tpl.php or have you modified it?

paste your node.tpl.php file here

Is the image actually getting saved on the server?

What Display setting did you set for the image in teaser/full node views? (in the content type display settings)

I have to say this, squeezing these details out one by one is getting pretty tired.

stephtek’s picture

Here is my CCK node template file: node-pgblog.tpl.php

<?php
// $Id: node.tpl.php,v 1.4 2007/08/07 08:39:36 goba Exp $
?>
<div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
  <?php if ($page == 0): ?>
    <h1 class="title"><a href="<?php print $node_url ?>"><?php print $title ?></a></h1>
  <?php endif; ?>
    <div class="taxonomy"><?php print $terms ?></div>
    <div class="content">
	<div class="tabs"><?php print $tabs ?></div>
    <?php print $content ?></div>
    <span class="date"><?php print format_date($node->created,'custom','F n, Y',$timezone = NULL) ?></span> 
    <?php if ($links): ?><img src="<?php print base_path() . path_to_theme() . "/images/icon-comment.gif"; ?>" width="10" height="9" alt="Comment" title="Comment"/>
    <?php print $links ?>
    <?php endif; ?>
    <hr>
</div>

It looks like my images are getting posted to the sites > default > files folder. There is an image cache folder with a "thumbnail" folder and a "large" folder inside it but my images are on the root level of that directory.

I set the display setting for teaser to thumbnail and the full node to large.

Jeff Burnz’s picture

So "thumbnail" and "large" are imagecache presets you configured earlier?

Hitting a dead end here, btw where did you get the node.tpl.php file - looks like Bluemarine but the version has me stumped?

Anything in the HTML like and empty img tag (view source on the page in your browser), the other trick is to pull up the image with your browser (type in the full path to the image), to see if the imagecache derivative gets generated.

Getting to the point where I need to see a live site.

stephtek’s picture

Seriously i really appreciate your help! I am so stumped!

The dev site is http://www.ruins.ca/new and the blog part I am having trouble with is http://www.ruins.ca/new/blogs/pgblog.

OMG.. sorry but i just ran update.php and it started working!! My only concern about how these are posted, is there a way to put them throughout the body of the full node?

stephtek’s picture

I just found this tutorial (http://www.anelloconsulting.com/trying_out_lightbox2_imagecache_and_imag...) but it is a bit to advanced for me. Could use a few more steps for configuration etc... if anyone can help!

stephtek’s picture

I just cant seem to get it right... i must be missing something!

Vayira’s picture

Is there a way to add a WYSIWYG with image resize automatically? If so what WYSIWYG would you recommend.

You can do it with FCKeditor. It is even quite clever, you can drag & drop images from elsewhere on the same page, resize with the mouse etc.

I can't quite make up my mind if I would recommend it or not. On my localhost it gets confused about paths sometimes & it can run a bit slow.

It is one of the few WYSIWYG editors that goes with D6. Read the installation instructions carefully as you have to download it in two parts.

stephtek’s picture

Great, I will try that if this doesn't pan out. I did briefly try FCK but it didn't show up for me.

Vayira’s picture

If it doesn't work. You have to install the javascript separately from the rest of the module