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 1116063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T03:14:52+00:00 2026-05-17T03:14:52+00:00

I have a new content type called ‘A’ which has a cck reference node

  • 0

I have a new content type called ‘A’ which has a cck reference node field that makes reference to type ‘B’.

I have a custom template that renders out all node types ‘B’ in a very specific way.. the problem is that for this template, I need to know who the current node belongs to.

type B will always have a parent (of type ‘A’).. but I have no way to know the nid of the parent.

Is this possible?

So in short, when $node->type == ‘B’
print $node->parent->nid???????????? how can this be done?

  • 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-17T03:14:53+00:00Added an answer on May 17, 2026 at 3:14 am

    Old Solution: Try using the http://drupal.org/project/cnr (Corresponding Node References) Module. This way you will be able to find out the “parent” of Node B. Basically you will get a node reference field in Node of type B that points back to a Node of type A (the “parent” node). Also you will only need to update one of the Node Reference fields — the other will be kept in sync automatically.

    Alternate and Better Solution

    Try using the Node Referer Module. See http://drupal.org/node/431308

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

Sidebar

Related Questions

I have the following scenario: I have a content type called 'Product' in which
I'm very new to drupal (started yesterday), I have created a content type called
We have a new client that we will be hosting content for. The client
I have been trying to create a new content type for Plone based on
I have a CodeIgniter MVC application. I have a model called city that has
Most of my content is in a new table I have added to JOOMLA
I am new to jquery mobile, and am having problems getting content I have
I've got a content type called contact. One user can create hundreds of contacts.
I have a function called GetIP which I call on startup and when the
I have a div on my home page which uses a jQuery plugin called

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.