Community

how to connect two content types and produce the result

I have users , who can fill two types of custom content types
1)Profile (name, address, city etc)
2)Package(item name, price etc)

(item name will be from a list of terms)

a user can have many packages but only 1 profile per user.

now how do I list all the price with name , address of a PARTICULAR package (item name which should be exposed filter) of all users

Thanks for any help

Comments

You're a little vague on the

You're a little vague on the details of what your trying to do but it sounds like you should not make the Profile a Content Type but rather simply add those fields to the user profile. Then the users would create the Package content and you can output the data using Views. Because the Package is tied to the user who created it through the User ID (UID) you will have access to the Profile information.

I know that everything could

I know that everything could be put into the profile but I don’t want the user to fill all the details (there are too many) during registration. This is why I have created the profile content type.
And now I want to show the list of prices for that particular package of all user along with the name.

Please help.

You could create the profile

You could create the profile as a content type and link it to the user via a node or user reference field but then things will get pretty complicated when you try to output the information of a user and two content types via Views. But I suppose it may be possible.

If it were me, I would see if I could make the profile fields work as part of the actual user profile. This would greatly simplify things. You probably already know, but to be sure, you can make the profile fields show or not show when registering. So, you could only show a limited number of fields when registering. Then, once registered, they could fill in the rest at a later time.

Yes you are right setfree.

Yes you are right setfree.

But the main thing is that we cannot hide the things which are required on the profile (many of the fields are required).

And there is one more issue that there are various profile for different types of user, so once the user register, they will get their respective profile based on the role which are assigned to them.

So please help if you can, in constructing this view.

Thanks a lot for your continuous help.

generic solution

There is an excellent, extensive, and in-depth screencast series on the views module at http://vimeo.com/21051899. The series is long, but you might be able to figure out what you need from it.

more specifically

You could create a view with field: node:body. This should load all nodes into the view. You can probably filter the view by content type. (A way around this is to filter by keyword or tag) This should limit the nodes in the view to packages. You can create a filter User: roles. You may need more than one of these. You also may need to play with the operators for these filters in order to get the correct logical combination. Then you need a filter (probably of type: content) that specifies the author. This is the hard part. It is easy enough to enter the names of each user, but that will take to long. You need a way of inserting a token such as !username. I am lost as to how to do this. Maybe someone else knows...
Hopefully this helps at least a little.

potential fix

It looks like the panels module may have the fix I suggested looking for.
See http://vimeo.com/22794232. With panels you can use the token %node:author.

thanks to all of you , I will

thanks to all of you , I will try and get back.