I'm trying to understand drupal nodes, and I think I have an idea. But I don't understand how nodes interact with each other.

1. If I have an image node (a picture of a dog), and a story node (a story about a dog), is there a way to put the image node inside the story node?

2. Or I am going about this all wrong? If all I want to do it have a story about a dog with an image of a dog in it, then should that just be a single story node, that happens to have an image file (non-node) within it?

3. And if I have an image file in this single story node, can this image still be tagged in taxonomy, or can only acutal nodes be associated with taxonomy terms.

Thanks sooo much!

Comments

zeta ζ’s picture

See http://drupal.org/handbook/modules/image

When you use image this creates a node for each image that you upload. You can use cck to add other fields to this content-type image, or use image_attach to associate your image nodes with other nodes.
___________________
It’s in the detaιls…

demonstration portfolio

ktleow’s picture

Answers to your questions:

1. Are you using Image module? If so, then you can enable the Image Attach module and configure it to your node type.

2. There are many ways of doing this. The most common way is by using Content Construction Kit (CCK) module. CCK allows you to add custom fields (including pictures/images) to nodes. After that, download and install IMCE or ImageField. Refer to the drupal Handbooks for more information on CCK.

3. Not sure about this though. But there's a module Taxonomy Image. I haven't tested this yet.

zeta ζ’s picture

Taxonomy image allows you to create a vocabulary where each term has an image. Tagging a node with any term, associates that image with the node.
___________________
It’s in the detaιls…

demonstration portfolio

-Anti-’s picture

> Tagging a node with any term, associates that image with the node.

'associates'?

Can you explain what that means, and what it can be used for?

For instance, if a node is tagged with 'news' and a newspaper icon is associated
with that term, does the icon display in the node somewhere? If so, how do you
control where?

zeta ζ’s picture

Your example is right: the icon can be displayed with the term ‘news’

eg. in my site below, each node is tagged with a set of terms, and each term has an icon.
___________________
It’s in the detaιls…

demonstration portfolio

-Anti-’s picture

> Your example is right: the icon can be displayed with the term ‘news’

If I wanted a news node to have a newspaper icon in the top-left of all
stories tagged with 'news' would I do that in the theme, or a content-type field?

> in my site below

Sorry, I couldn't see your examples - I just got 404 errors when trying to view nodes.

Cheers.

zeta ζ’s picture

You could use many different methods if you want all news-type nodes to have the icon, you can include an img tag directly in the node-news.tpl.php file. If you want only the nodes tagged with news to have the icon, use taxonomy image – the icon will be with the term. If you want to choose the icon independently for each node, use image field, which is a cck field.

The examples are on the front page.
___________________
It’s in the detaιls…

demonstration portfolio

ktleow’s picture

That's right. I hope we have answered your questions ^^

-Anti-’s picture

I think I understand where you're coming from - I'm a noob with the same confusion.
And despite the welcome answers, I still don't quite understand!

Let me try to redefine the question (for myself - hope you don't mind the hijack!):

If we use the image module to upload an image, so it becomes a node in itself, can it still
somehow be used 'inline', within the content of another node? In other words, can we use
it as a 'normal' image placed in content *and* reap the benefits of it having its own url and
taxonomy, so that we could also get it to appear in galleries, Views, etc?

Or, should we keep 'image usage' separate - images that need to be shown in galleries and
Views should be uploaded as nodes using the image module to utilise the taxonomy, and
images we want to use as inline content should be uploaded using the core 'attachment'
module, or the 'image attach' module and then utilised with IMG tags in the content of
the node?

It's a real shame these image modules, since they're so important, don't have demos.

Thanks.

ktleow’s picture

If we use the image module to upload an image, so it becomes a node in itself, can it still
somehow be used 'inline', within the content of another node?

Answer is yes. Once you have uploaded an image with the Image module, you can use its accompanying module, Image Attach to attach it to other nodes.
Enable the Image Attach module as well. Then go to Content Management > Content Types. Select the content type you want the image to appear, there will be another fieldgroup defined as "Image Attach settings". Enable it. Walla!

Btw theres an article written by Lullabot here. They've summarised and made a comparison between Image, Imagecache, Imagefield.

It's a real shame these image modules, since they're so important, don't have demos.

Yep, totally agree. Would be better if they have a tutorial on how to use these modules that includes screenshots.

-Anti-’s picture

> Image Attach to attach it to other nodes

As I see it, this is the real cause of confusion - these modules use words like 'attach'. For me, 'attach' means like an email attachment, separate from the content. Like the core upload module - it 'attaches' a file to the bottom of the content.

Why, if a module allows the user to use an image or media inline within node content, are they so reluctant to use the words 'insert' or 'embed'? It is totally confusing when there are modules which really do 'attach' things to node content.

Anyway, thanks for the lullbot article - I hadn't seen that... and the additional clarification.

Cheers.

ktleow’s picture

No problem:)

About the 'attach' issue, maybe you could submit an issue queue to the Image module ^^ and recommend them to rename to 'insert' or 'embed'.

By the way, there's another module (no more confusion) that helps in uploading images to nodes too. Check this out, FileField Image.

XD

zeta ζ’s picture

But it is attached. It is not part of the node, unlike other solutions. But the system is also configured to display attachments somehow.

Those solutions that embed an image, allow you to choose where in the node to embed it. Attached images, I believe, are displayed in the same way, consistently across all nodes.
___________________
It’s in the detaιls…

demonstration portfolio

-Anti-’s picture

> It is not part of the node, unlike other solutions

Bear with me - I'm sure there is a eureka moment coming soon! lol

OK, the IMCE image-browser module: you navigate to the image, click 'add'
and it places an IMG tag into the body of the node. This is 'insert'.

With the image_module, you upload an image, choose the image from a field
in the content-type, and.... well, I don't understand what happens next. Presumably
the image appears in the node somewhere, exactly as if it was 'inserted', but you're
saying it is attached? I just can't see the distinction, except two different ways of
selecting images to display in the content.

Also, where does the field in the content-type know *where* you want to place the image?
How is it floated or styled if you're using a form field?

Sorry to perservere with this, but I spent several days going through all the modules, docs
and demos to see which modules were suitable for allowing users to easily add images and
media, and made a shortlist to test. But I automatically discarded any module which clearly
did not say 'inserts an image into node content'.

Thanks for your patience.

zeta ζ’s picture

Have you read;-
http://drupal.org/handbook/modules/image &
http://drupal.org/node/191718 ?

IMCE – correct.

Image – upload images and create nodes for them – the node is just the image.
Image_attach – attach image nodes to other nodes – use themeing.
Image field – a field-type in CCK – use CCK themeing.
img tag – like IMCE.
___________________
It’s in the detaιls…

demonstration portfolio

-Anti-’s picture

Yeah, thanks I read those before, trying to figure out if they 'attached' (as in a link at the
bottom of the content) or 'inserted'. I discarded them because they used the word 'attach'
all the way through. I shortlisted IMCE and Image_Assist instead.

> Image_attach – attach image nodes to other nodes – use themeing
> Image field – a field-type in CCK – use CCK themeing

OK, now we're (I'm) getting somewhere. The image module uniformly places an image
of fixed size and position into a node depending on the themed content-type.
Basically every post of that content-type would have the same image layout (?)

But if you want your users to be able to upload and position additional images into
their post, then you'd have to use one of the image-browser 'insertion' modules (?)

Am I conceptually closer? lol... it makes perfect sense to me to have a method for
fixed image placement per content-type and a user-controlled one for additional images.
In fact, I was wondering the other day how I was going to do that with only IMCE and a
wysiwyg template!

Thanks for your replies and patience; you're always very sensitive about my ignorance.
For what it's worth, I've got a fever and every muscle in my body is on fire - can't think straight.

zeta ζ’s picture

All correct except the image module. This creates nodes that are of type ‘image’ – they are just the image! (and a title etc.).

You can use CCK to add other fields to the image node-type, but then every uploaded image will have those fields. Therefore it is better to add those fields to a CCK type – then you can attach the image nodes to any other node (CCK or standard nodes).

My patience is because I too, have had to get my head around the different implications of so many possible solutions. And I still have to refer to the documentation. Hope you’re better soon.
___________________
It’s in the detaιls…

demonstration portfolio

-Anti-’s picture

Bingo! Thanks. OK, this opens up new avenues to explore!
But for now I'm off to moan and wail in bed. ;)

NB: Rangy... sorry for hijacking your thread! Glad it helped a little.

rangy’s picture

Thanks to everyone for replying to my original post. This thread has really helped!

Going along the same lines as my original example. Assume I have a story node about a dog, and I attach an image node about a dog as discussed above.

Now I want to add a flash video node to this story.

If I use flashnode, it seems that I can basically use this module to add my flash, and then use the body area there to "add my story". However this would be sticking my story inside a flash node, which according to everything I've read, kind of defeats the purpose of the beauty of organizing things in drupal

Would I need an image_attach-type module for flash (e.g. a hypothetical flash_attach?), or should I just create this "story-within-a-flashnode" to solve the problem.

Or is this a situation where the CCK comes into play?

Thanks.