Hi,

I'm kind of in a stupid thinking circle and can't figure out or find a solution...

What i want is a view of related nodes from the node wich is selected/viewed based on content type...this must be easy but somehowe i can't get it to work...

Anyone any idea how to get this working?

Thanks,
Henk

Comments

henkit’s picture

Anyone?

audster’s picture

well, without any information about how you are trying to go about it, it's hard to give guidance...

even though this screencast series is for D7 it will show you the logic needed...
http://dev.nodeone.se/en/taming-the-beast-learn-views-with-nodeone

I would do this by context (arguements in D6) or taxonomy...

This series is long, but everyone I have sent to it has LOVED it..!

It's worth the time and effort!

henkit’s picture

Thanx for the reply! i'l try to give a better description;

I have a page with a list of nodes from different node type with just a title, if you select the title of the node you will get the full node...what i want on that page is also a list of node (titles) from the same content type who also can be selected.

What i did try is a view with node:type argement but that does not work...in my opinion that should be easy like when you want to show a list of content that was created by a user, that's done by a few lines of php code in the view..

I will also look into link you send me

Henk

audster’s picture

Bear with this...

So here's how I would do it (although God knows that with views there's a zillion ways to skin a cat...we love MerlinofChaos!)

I would create the base view that basically pulls in all the nodes
create another page (or a block, depending on how you are going to use/display it) under that same view and override the filters to get you a list by content type only.
so something like

BASE VIEW: all content types
SUB-PAGE: filter for content type (as an override to the base view)

It sounds like you are already trying that so I'm puzzled as to why it's not working... maybe you can post an output of the query for perusal?

Can you tell me what you do get when you try the "by specific content type" view?

(btw, unless you are going to keep all of your views stored in code, I wouldn't recommend putting php into your views... but that's me...I don't like to have code stored in the DB

see:
http://drupal.org/project/views_php
http://drupal.org/project/viewsphpfilter
http://drupal.stackexchange.com/questions/2509/what-are-the-downsides-of...)

Also, in my experience with database queries in general (and I am NOT a guru, in fact I HATE working with databases, love the power, but truly hate working with them - I am not alone.) I often just start again from scratch, sometimes the culprit is right in front of you but you just can't see it. As where when you just start from scratch, you are forced to think it through again and you have that, "oh DUH" moment and you suddenly realize why it wasn't working. (then you wish you could post your solution under some pseudo-name to help the other poor sots that are having the same issue, without everyone knowing you were also the same poor sot. Alas, I just take my lickings and post them all as me. )

henkit’s picture

Hi Audster,

I used the module featured_content for now, that works...but in my opinion it should still be possible with only views...

Anyway, thanks again for your reply also for the tutorial site!! :)

Henk

henkit’s picture

Hi,

After using similarterms a while i needed more info on the page...i think i found a solution that very suitable for me with views and panels

I'm using:
Drupal 6
Views 3
panels

1. Create a view with Node:title and Type for example
2. Add a Argument Node:type, display all set
3. add a filter Node:published on yes
4. Set
Save

From Site construction > Pages enable the node_view page and:
1. Add Node being viewed content to region
2. Add the view created from the first steps to region and set the following options:
3. Select Node-Type form Node:Type (second from top)
4. Fill in @0 at Argment (second from bottom)

Save

Now, if you select a node the view should appear below the node..

Henk

daniender’s picture

I know it has passed a lot of time since this thread was opened, but it is the closest one I have found to my problem.

I also think my problem should be very easy to solve, but I can not find the way.

I have 2 content type: sale and client.

Each time I create a sale, I attached it to a client using a node-reference field, so in each sale in database I have a node id reference. What I want is simply to see a list of sales, when I click on a client detail.

I have created the view, with the table, and all the fields (columns) I want to see from the sale (price, date, etc.), and also added some filters like published, node type: sale, but I need to add another filter or relationship or whatever that tells the query: WHERE node_sale_client_id = client.id, or something like that.

Any idea how to manage this from views?

Thank you very much.