Drupal 7 webform/entityforms with node reference - drupal

I have a form on a node, that displays 2 fields that are entity reference fields from the current node page. It shows the correct info on the label of the fields, but as soon as you save the form, it saves the nodes title and not the correct info.
See screenshot at https://www.dropbox.com/s/rwj1lu1d34zgb53/ScreenshotEntityform.jpg
I don't know PHP or how to mod/write a Drupal module, I just need some guidance as to if this is possible and how to do it, so any help would be really really great, thanks.

There is a setting to edit how an entity reference field is displayed.
If you go to Structure > Content Types > Your Content Type > Manage Display then you will see a select box to control the format of each field.
The entity reference field will let you choose between either label, entity ID or rendered entity. It sounds like at the moment it is set to label so is showing the node title. If you set it to show the rendered entity then it will show all fields that belong to the referenced entity.
The easiest way to hide fields you don't want displayed would be to install the Field Permissions module. This will give you a setting for each field that allows you to choose who can see it. If you don't want to use the Field Permissions module you could create a custom template but it sounds like your trying to avoid that...

Related

Drupal view field

In Drupal, I would like to display some user related nodes on their "My Account" page. I would like to do so by creating a View that i would add as a field on the user entity (through admin/config/people/accounts/display). I could use Computed Field in order to load and render the view but that is not very convenient as it requires me to write PHP code.
In short, is there a module that allows to add dummy fields containing a view in the "manage display" sections of entities?
Thanks for your help.
Yes, Viewfield. This allows you to reference a view and renders it.

Drupal 6.20, fields missing when viewing a node appear when editing

I have a node that contains 6 fields. When the user views the node, the only fields that appear are those for which the user has already entered data. When the user edits the node, all the fields are visible. I have inspected the HTML to confirm that the missing fields are not being hidden by CSS. How do I make all the fields visible when the user views the node?
If the field is empty, then drupal won't display it.
You can create a views with Views Module http://drupal.org/project/views and display all fields with a default value.
Contemplate is also a good solution to create easily template for your node : http://drupal.org/project/contemplate

Newly added Drupal cck fields are created but not shown when published

I have a content type which has several fields. When I add new fields to this content type, they get added. I am able to enter data into these newly created fields. But when I publish it, the previously existing fields are shown. But the newly created fields do not appear.
I have checked the permission, cleared the cache.
Am not much aware of using view module. But there exist a view for this content type. Is that responsible for it?
Thanks in advance.
If the page where you want to see your fields is handle by Views, yep definitivly need to look into this views. There a lot of chance that the views only display fields (at the opposite of "full node" or "teaser"), and the fields it display are set in the views configuration.
Some modules will allow granular permissions per cck field.
You might check the user permissions page and see if there is a checkbox for "view {CUSTOM FIELD}" or "edit {CUSTOM FIELD}".
I found out what it is. Actually in the file node.tpl.php , there was an exception for the content type 'article' to print only the predefined fields. So, the newly created fields were not getting printed. But when I added the php code for printing these newly added fields, it worked. Thank you everyone for your time.

Drupal: Sub views?

I have a parent/child relationship (based on the cck node reference field).
Recipe Group contains a node reference to the type Recipe. It's a 1 to many relationship.
What I need to do is create a view that displays the recipe group information, and then under it, the recipes that have been assigned to it's cck field.
So
RecipeGroup1 - Title
Recipe1, Recipe2, Recipe3
RecipeGroup2 - Title
Recipe4, Recipe5, Recipe6
etc etc
I've created the view to pull the list of recipe groups.. but I have no idea how to retrieve the recipes that belong to the group?
I've tried googling, but we are on a tight time line and would appreciate any assistance.
Thanks.
Take a look at http://drupal.org/project/views_field_view. It lets you combine two views (groups, recipes), inserting the recipes view as a field into the groups view. Using this, you can have as many fields as you want for the group.
You can use the Views attach module to associate a view with a specific content type and display that view on that content type's node page.
There is a webcast here that demonstrates how the module can solve a problem similar to yours.
However, the webcast assumes your nodereference CCK field is on the child content type and is pointing to the parent content type, not the other way around like you have it.
Instead of using the nid of the recipe group as an argument to the view (as shown in the video) you may be able to use one of the recipe group's tokens (the nodereference field referencing its children). You can see that option at 9:32 in the video.
Whatever you decide to do, I think Views attach will likely be your answer.
Include the cck reference node field as an output field to your view. After, you can 'rewrite the output of this field'.. so that it looks however you want.
add noderefernce field in to views fileds
select check box to group field result in node ref field settings
theme that field as you want

Changing order of fields in Drupal's content type

I am using Drigg on Drupal 6.17. Drigg has a content type called as "Scoop". I try to change the labels and order of fields. Normally, this is done in Content Management > Content Types > Manage Fields . But some fields that are shown in Create Content screen are not shown in Manage Fields screen.
The screenshot of Manage Fields is here:
The screenshot of Create Content view is here:
The first three fields (Submit the scoop as.., Scoop's URL, Scoop) in Create Content form are not shown in Manage Fields view.
I would like to ask the reason for this. They must be defined somewhere else. Where is it?
Manage fields is for editing CCK fields that you have added. Other fields from different modules often have a weight setting that you can change to move the field up and down, which you would get to from the main content type editing page.

Resources