Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5962503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:06:53+00:00 2026-05-22T19:06:53+00:00

I have several custom datatypes in drupal 7 restaurant menu recipe chef i want

  • 0

I have several custom datatypes in drupal 7

  1. restaurant
  2. menu
  3. recipe
  4. chef

i want to create associations between this data chef -> restaurant -> menu -> recipe
so that recipe can get the chefs name and the restaurants address
and menu can get a list of recipes, etc

In SQL land, i’d call this a foreign key, but i’m having a lot of problems finding how to do this in drupal 7.

I suspect that there must be some module or functionality i’m not familiar with. But drupal uses it’s own lingo and I think i’m falling down on my google-fu

anyone know what i’m looking for ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:06:53+00:00Added an answer on May 22, 2026 at 7:06 pm

    These are probably not datatypes but most likely content types. What you are looking for are

    • A way to relate nodes (ie. content) of one content type to nodes of another (chef to restaurant, menu to restaurant, recipe to menu, etc.).
    • A way to display information from related nodes (direct or indirect relations) when displaying a particular node.

    The relation between nodes can be achieved using the References module (a Drupal 7 port of the nodereference module included in CCK for Drupal 6). This allow you to add references to nodes when editing another. The relation can be configured to allow only nodes of the specified type to be referenced. These kind of reference aren’t bi-directional and can only (easily) navigated from the referrer node, not from the referenced node. In Drupal 6, the Node referrer provided a complementary field to navigate the relation both way. Unfortunately, it has not (yet) been ported to Drupal 7.

    References may be deprecated in a near future in favor of the Entity reference module. Entity reference clains to provide bi-directional queries via views and proper integration with the Entity API module. The later should ensure that relation defined with the module are fully (problematically) navigable and usable with modules using the Entity metadata (Seach API and others).

    Another solution which is also using the Entity system, is the Relation module. It provide complete bi-directional relations. These relations are themselves fieldable entitiesm which means that you add properties to the relations (for instance the dates at which a chef started and ended working at a restaurant).

    Once you get the relation, there is various ways to display the related information on a node page. I don’t known for Relation, but if References behave like the Drupal 6 version, it will only allow basics display of information from the directly related nodes. One solution is to implement hook_node_view() in a custom module to navigate the relation, retrieve the different nodes, format the gathered information using a custom theme hook and add it to the $node->content for rendering.

    Since Entity reference integrates with view, you should be able to build a view to display the node related to the currently displayed node (using the current node as contextual argument). You can then embed the view programmatically in your node view (again, via hook_node_view()) or use a block display.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several custom uibuttons on my view. I want to create a toggle
I have a custom view with several NSTextField controls for which I want to
I have an event organizer where a user can create one or several custom
I have several links I'm trying to create to either perform custom controller methods
I am writing a custom NSView subclass. I have several instances of this class
I have several custom components which extends LinearLayout . Now I want to save/restore
I know this sounds knit picky but I have several custom controls that have
I'm using a custom JLayeredPane. I have several Shapes which needed to be drawn
I have custom coded several enterprise applications for mid to large organizations to use
I have read several documentations about building custom ErrorHandler (by inheriting from IErrorHandler). Unfortunately,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.