D6.22 - attach content to node type


This is actually pretty easy.

  1. Edit your content type (or clone to a new type). Add in a noderefernce CCK field as needed. Configure it for not mandatory, but limited to one value.

  2. Edit the fields for the type so that they are all hidden.

  3. Add a preprocess_node for your content type in template.php to read in the node relationship, theme the node, and then add it as a theme variable.

  4. Create a node template for your type.

  5. Edit the node template, to add in your div in the markup.

  6. Print out this theme variable in the node template.

This should get you down the right path.

Tags: Drupal 6 / Nodes

Similar questions

What hook should I use to attach a script to a content type?
I have this function from a standalone php script that redirects the user based off the user agent. In the process of merging this into Drupal and the script only needs to execute for a specific content type. Not 100% sure what is the best hook to use: hook_node_presave(), hook_load() or hook_node_view()? Or should I run this as a template pre-proc...
What does "attach to content type" option in Feeds importer do?
I am struggling to find a clear explanation of what the "attach to content type" field in the basic settings of a Feeds importer actually does. The closest explanation I can find is from here: "Feeds importers" can be used attached to a content type or on standalone forms. If attached to a content type, an import (or aggregation...
If content type with specific field that is not empty has specific taxonomy term attach library
I would like to attach a specific library using a taxonomy term to a content type with a specific field that is not empty. The following is not working:
Attach class to menu item based on content type in Drupal
I have seen a few functions that allow one to attach classes/ID's to menu items; unfortunately, none of them apply to my use case. What I want to do is assign a class/ID to any menu item based on the content type of the linked item. For example, I have a content type called "Internal" which is only displayed if the viewer is within the accepted IP ...
Attach existing cck field to existing content type in Drupal
Without going through the UI, how would I add an existing CCK field type to an existing content type in Drupal? I'm imagining I could add the change of configuration straight to the database in an 'install' file, but if not, which hook should I call for this?
What is the best method to allow a user to attach dynamic, custom content sections to a node?
I am looking for a recommended approach for a customization in Drupal I am building. The desired workflow: A user will be able to attach N number of custom content sections (CCS) to a node. A user will be able to select the type of CCS (see example below), customize it, and arrange it's order amongst all other CCSs attached to a specific node. Exam...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.