Hi,

I want to create a site where I can add a description, features, and user reviews of products. Rather than have a description, features and user reviews as one node, i'd like to create seperate nodes for each "section". These will then have their own tab on the main node. I'll explain more clearly...!

Let's say I want to review a John Deere Lawn Mower. I create a node with descriptions and information about the mower as the main node. I then want to add another node which will attach to this main node with the features. Then, another node which will allow user reviews. These will be linked together with tabs (ajaxified if possible, but this isn't essential just yet).

What would be the easiest way to achieve this?

Sorry if this isn't very clear, I'll try and explain again if it can't be understood what I want to achieve.

Thanks for any help.

Comments

nevets’s picture

In Drupal 5 I would have made one content type broken up into groups (your tabs) and then displayed the groups as tabs. You will need the CCK Fieldgroup Tabs module and it is available for Drupal 6

cog.rusty’s picture

Maybe the http://drupal.org/project/cck_fieldgroup_tabs module

It requires the http://drupal.org/project/tabs module and of course cck, and it puts groups of fields in tabs in the same node. cck_fieldgroup_tabs is still a dev version, so I am not sure how stable it is for a production site (check their issues queue).

Maybe the panels 2 module with its tabbed mini panels will make it easier.

There is also the http://drupal.org/project/talk module for displaying the comments separately.

2ndChanceTech’s picture

I do this on my website using multiple nodes to complete create "hubs"

Example:

Content Type = Actor (Main type)
Content Type = Movies
Content Type = Review
Content Type = Image
Content Type = Forum Topics

I then put a nodereference field in movies, review, image, and forum topics.

then made a view that displays all movies referencing the current actor.
Did the same for review, image, and forum topics.

personally I use panels for my pages, but blocks and regions will work as well.

So on the Actor node, I simply have blocks of "reviews" "movies" "Tv Shows" "Forum Topics" etc.

leading to the appropriate node. Which gave them their own page.

I didn't put them ALL in tabs, but I made a block that has |Movies|TV Shows| tabs.

Sorry for the long explanation, but I wanted to make sure it's that type of functionality your going for. If so, here's the short form version of getting it to work, using product + review node types:

Create Product Type
Create Review Type (Add nodereference field limited to product type)

Fields: Node: Title
Node: Author

**The fields you use are upto you, or you can display using teasers, full nodes, or other view types

Create a view with filters:"Node: Published - Yes"
"Node: Type - Product"

Argument: "Node Reference: field_product" (or whatever you named the field)
Argument Handling code: $args[0] = arg(1);

I believe this is what makes sure the reference is pointing to the node being viewed (not really sure, found it in the forums, and it works properly)

Choose whatever sort criteria you want.

Now take that view block and set it to only show up on Product Pages.

Make a sample product, make a sample review, node reference the product then visit the product page.

In the block you made you'll see the review. You can make all your other content types, place them all in a region, and use tabs to output the content. Hope that helps let me know if you need more assistance. Hopefully that's what you're going for, because it took a bit to type, if not, hopefully it will help someone else. My sites entire functionality is based on this concept. It's awesome.

2ndChanceTech’s picture

I realized that you probably don't need the argument code, because views2 I believe creates a backreference (not completely sure). I saw something in the handbook about it.

Jboo’s picture

Thanks for the replies.

cog.rusty and nevets - the fieldgroup tabs module looks really useful, probably ideal if I can work out the review section.

kryptik - thanks very much for the explanation, I can see how this would work for my site and appreciate the details on how you did this.

As just mentioned, the main thing i'm now thinking is what would work best with the review section. The other sections (description, benefits) would be created by me so the "behind the scenes" node creation shouldn't be a problem. The review section though, will be an area where site visitors can add their own review along with their vote/score for the product. I think it *might* be good if the node has a tab to the review page where there is a list of user reviews with their voting, or a teaser of reviews with links to the full review but still linked to the main node (this is getting more difficult as I go along!). Any tips on this part would be great. I guess I could do this with the review module or with a custom content type using the nodereference module?

Thanks very much for the replies, I really appreciate the help.

My new EasySnoozing, Nursing and BusinessEgghead websites on D7!

2ndChanceTech’s picture

it sounds like you're mainly concerned about how to make the "Reviews" section a tab under each "Product".

This is mainly a cosmetic thing. What you would want to do is create a "view page" with the "node id" as an argument. like (node/$arg/reviews)

then construct a link that leads to node/$arg/reviews

The argument needs to be passed from the currently viewed node. (not sure how to do this in blocks, but it's easy in panels).

Either way, if you pass the Node Id, from the "current node", to the "view page", (then it would lead to node/15/reviews.

In panels, all you do is say "link title to view" and it will pass the argument for you. Again the tab part, is more of a cosmetic.

In your case (and mine). After you've sent the user to the view page, it's important to theme it to look exactly like the product page (if you want that is), and also important to remember that on the view page itself there are no edit/view tabs, as views are not nodes. When you click a review the edit tabs will pop back up.

You may want to check into insertview or viewreference or something along those lines. What they allow you to do is reference a view and have it inserted into a node. However I haven't used them.

Jboo’s picture

Ok great, thanks kryptik. I'll run through your examples and see what I come up with. Thanks for explaining everything so clearly, I can actually picture how to achieve what I want now :-)

My new EasySnoozing, Nursing and BusinessEgghead websites on D7!

2ndChanceTech’s picture

this is very relevant to what you're trying to do.

http://drupal.org/node/296959

Once you've created your view the way I described originally, in the "view Page" area, you can create the tab only on the content types you want, following the directions in the link above. Hope that helps.

Jboo’s picture

Thanks. Doesn't currently work I think because of the change from node/$arg/reviews to node/%/reviews in D6. I think this is why the node/$node-story/who URL suggested in the URL doesn't work, but I'll look for a solution for Drupal 6.

Thanks again.

My new EasySnoozing, Nursing and BusinessEgghead websites on D7!

2ndChanceTech’s picture

you should be able to follow the flags view guide for views2.