1

I created a new content type (Image), which has an image upload field set. Now I can upload images and they are now nodes. But what do I need to do to add them to other existing content types?

My guess was to turn the image content type into a block. Is this correct?

closed as unclear what you're asking by Adrian Cid Almaguer, Shawn Conn, Mołot, niksmac, Krishna Mohan Feb 1 '16 at 13:18

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • What do you mean by "but what do I need to do to add them to other existing content types" . You need to duplicate an existing content? – No one Jan 30 '16 at 19:06
  • Well I am trying to put a picture on top of a webform. So I am assuming I need to turn the image into a block in order to do that. – Shawn Jan 30 '16 at 19:09
  • So you need to display a set of images of already created contents, right? – No one Jan 30 '16 at 19:18
  • 1
    Well not a set of images, just 1 image. I think what i need to do is actually add the image field to the webform content type, instead of trying to tack on 1 content type on top of another content type. Would this be correct? – Shawn Jan 30 '16 at 19:21
  • This 1 image is the same for the webform? – No one Jan 30 '16 at 19:24
4

My guess was to turn the image content type into a block, and if so, whats the best module to do that?

Bean

Bean is an acronym that stands for Block Entities Aren't Nodes.

This is a great introductory article about what the bean module.

What is Bean? Think of a Bean as a method to provide new types (compared to node this would be a content type) which then provides an add content interface to create as many blocks as you require (see screenshot below). The bean content can then be placed around the site just like any other block.

Beans were driven by the API first. This means that you can create block types (bean types) all in a plugin class turning off the UI. The entire configuration in code. No worry about feature reverts.

Here is a video tutorial

Basically it lets you add fields to blocks. This module comes with Drupal 8 core by default.

1

You don't need to have an image content type to upload images and use them in your other content types.

Simply add an image field to your content type and you are good to go. Basically, at uploading an image, its url will appear, and you can then use that url in an in the body of your node.

But there is another way.

You can also use the modules imce,plupload,imce_plupload combined with ckeditor or wysiwyw editor. After correct configuration you will be able to upload images and to manage them with the imce file browser. Doing so, your content type doesn't need image field anymore, as part of its structure.

I advise you to carefully read the README files if going that second method, because making all of those work correctly need the correct setup, explained in the documentation. It's not click enable and go.

1

Existing answers are misleading. What you need is exactly File Entity module, which enables to add fields to file fields.

File entity provides interfaces for managing files. It also extends the core file entity, allowing files to be fieldable, grouped into types, viewed (using display modes) and formatted using field formatters. File entity integrates with a number of modules, exposing files to Views, Entity API, Token and more.

1

I guess that what you need is Entity reference

Provides a field type that can reference arbitrary entities

By (1) adding an entityreference field to your webform content type you will be able to attach-link your "Photo" nodes to webform nodes. (2) From the "Manage display" you may adjust the field's position and set its format as "Rendered entity".

Hope that helps!

Not the answer you're looking for? Browse other questions tagged or ask your own question.