Creating a up reverse node reference list of a node in Drupal 7 - drupal-7

What we are trying to do in Drupal 7: create a block that can be attached to a node view or taxonomy term view. In this block, a user can add links. These links can point to contacts, documents, links to other websites or taxonomy terms.
In the back-end, a user can select a contact, document or link. The user then gets a list of all nodes where this link is used. If the link is changed, it is updated in all the nodes where it is used.
In other words, a node reference that works in both directions, for multiple nodes. Any ideas are mightily appreciated :)

Hi have you tried to use Corresponding node references module? http://drupal.org/project/cnr

You can use:
http://drupal.org/project/content_dependency
It works for both node reference & entity reference modules automatically.

Related

Drupal 7 unable to get referenced node in view

I have a node called "Student" I have another node called "Personal details".
I have made relations between them using entity reference module.
Now I am creating a view to get details of all students. I created a view of students and selected Content "Personal details" on fileds of the view. But I am only getting the id of the "Personal details".
I am struging to get the name and other fields of personal details node.
I used Relationships-> Entity Reference: Personal details and added content entityreference in fields but it is not displaying aything when i printing the view using get_view API.
Please help me on this.
I think this should work. Try to create a view for all types.
Select the fields that you want to display (the fields from students and personal info ). Chose to display both Id's from Student node and from the Personal info node, but make 1 of them invisible, to not be shown. ( you will understand why in step 4 ).
Add a filter, the Global: Fields comparison.
Select the two fields that have to be equal (the ID's).

drupal commerce browsable catalog

I am finding some troubles how Views works with taxonomy terms. I hope you can help me. :-)
I am building an e-commerce site with Drupal Commerce since it has all features I need for my project requirements but I don't know how I can list terms and nodes belong to concrete taxonomy on Views.
I have a product hierarchy taxonomy with all the site product categories. I use Taxonomy menu in order to show this taxonomy in a menu block allowing the user to select any term. A product display node only can be referenced to a sheet term on the taxonomy tree.
I want to use Views by listing as terms as nodes, if the user click on a non-sheet term on taxonomy menu, the view should show the subterms from clicked term. But in the other hand, if the user clicks in a sheet term then the view should show nodes referenced to the clicked term.
For instance,
Let's imagine I have the next taxonomy menu:
products
term1
term1.1
term1.2
node1
node2
term1.3
term2
node3
node4
If the user clicks on term1 term the view should list term1.1, term1.2 and term1.3 but if he/she clicks on term1.2 it should list node1 and node2.
How can I do this on Views? How can I list two different types of entities depending what term is clicked?
Thanks in advance!!
You need some js to do this. So you can use the dHTML_menu or similar dynamic menus.

How to know the link clicked by the user to set the breadcrumb using views in drupal 7?

I'll try to explain my problem giving a little context first.
I'm building a catalog of products and to categorize them I'm using a taxonomy tree with 4 sublevels. Each product can be related with one or more subcategories.
I used views to navigate the taxonomy tree to access the products related with each subcategory. To manage the breadcrumbs in here I redefined the hook_breadcrumb() function on my template.php and this is working perfectly.
The problems start here: when I get to the last level of subcategories I have the respective products and when I click one of the products it will enter the node page of that product. At this time I lose my breadcrumb trail because I entered the node. I could get the taxonomy tree of that product to build the breadcrumbs but the problem is that the product can be related with multiple subcategory terms.
So, in order to solve this problem I think that I need to know from wich path trail the visitor arrived to the product. In other words, I need to know the last taxonomy subcategory that the user visited to enter a specific product so that I can build the breadcrumbs correctly with that information.
So, can someone help me on how to know the path that the user was before entering a node?
Thanks in advance!
You can check http://drupal.org/project/cookiecrumbs a recent project which uses browsers history to show breadcrumb

Drupal 7: Form for node maintenance

I have a content type which will contain just one node.
I need a form for the maintenance of this node, with the following logic:
If the node exists, show a form populated with the fields content, and a "update" buttom;
If not exists, show a clear form with a "insert" buttom.
What is the Drupal correct way to do this?
Thanks for any help!
if the content type will contain one node why will drupal need to check weather the node exists?
Drupal rules http://drupal.org/project/rules coupled with the core triggers and actions modules can help you setup up system logic events

Different style when listing nodes and displaying a single node

I'm new at Drupal, coming from the PHP framework world, and I'm having some problems understanding the the template hierarchy in Drupal 7.
I've created a template called 'node--article.tpl.php' and can style my single article nodes. The problem is that this affects the front page as well. I want to style the node list different then when displaying single nodes. How can I do this?
/ Tobias
The front page lists nodes that are flagged to be promoted to the front page. You can flag/unflag each node in the Publishing Settings section of the node add/edit form.
Drupal provides a $promote variable that is available in the node template. So, you can use that in node--article.tpl.php when determining what content you want to output:
if($promote) {
print "<h2>".$title."</h2>";
} else {
print "<h1>".$title."</h1>";
}
If you need to get more complex in determining which nodes should be listed on the frontpage, you might want to look into the Views module: http://drupal.org/project/views.

Resources