complicated referencing and specific order of OTHER nodes from inside a node

Events happening in the community are now at Drupal community events on www.drupal.org.
alphex's picture

This one has me itching my head.
I'm working on a project for a client that has events.

These events are sponsored.

There are 3 tiers of sponsors.
Gold, Silver, Bronze.

I have a content type for sponsors.
That content type has .. title, logo, body... (I really only need it for the LOGO)

When making a new Event node, the author needs to be able to select sponsors that are in one of the ranks (gold, silver, bronze...)
"So, that's easy!" everyone says at the same time, "just use node_reference..."

Ah ha! not so fast.

I have to be able to assign them to a particular order in their ranks.
So, if we have more than one gold sponsor (or silver, or bronze), the order in which they show up needs to be able to be defined.
(see this screen shot --> http://alphex.com/z/sponsor_grid.gif )
Theoretically, we might add 1 gold sponsor, then 1 silver sponsor...
then a week later add another gold sponsor who has given more money, and have to make sure they are shown FIRST in the grid... not just... alphabetically or how ever it gets sorted by default if I were to pull in a list of node_references normally.

So, the question is. Is there a way to make reference to other nodes... (which I can theme what I want no problem), and somehow order them in the node/add or node/edit screens for that node?

Thoughts?
Tips?
Pointers?
Ideas?
Beer?

Thanks!

AttachmentSize
sponsor_grid.gif12.99 KB

Comments

Node Ordering Module

rj's picture

Have you tried checking out any of the node ordering modules, I've had success with both nodeorder and nodequeue: http://drupal.org/node/398508

--

R.J. Townsend

Nodequeue looks good... but

alphex's picture

Nodequeue looks good... but how does it store the order? I'm not sure opening up access to blocks, as one example is given in the project page for Nodequeue suggests... is a good idea for this client. Can we save that "queue" as it calls it, as a node, or a view? and then use node reference to bring it in?

The problem is that... Sponsor1.. for instance, might be a 3rd place GOLD sponsor on one event... and a 1st place GOLD sponsor on another event.
We can't just give Sponsor1 a 'higher weight' over all... cause that would mess up every event listing.

It has to be able to order the position of the sponsors, inside of the rank, inside of the event, and not effect anything else.

Thanks

Might want to try this:

rj's picture

Might want to try this: http://drupal.org/project/nodereference_views_select, looks like it lets you sort the order of referenced nodes, depending on JQuery UI Sortables.

--

R.J. Townsend

FYI, the module just referenced is no longer supported.

sk33lz's picture

I just found this thread while doing some research for some projects, and saw this at the top of the module that was just linked.

"UPDATE: I can no longer support this module as my day job no longer involves Drupal development. If anyone wants to take over development, let me knpw."

It doesn't seem to be supported any longer, so someone is going to have to setup up as maintainer, or this isn't a good idea to use most likely.

Yes, I saw that. Just b/c a

rj's picture

Yes, I saw that. Just b/c a module is no longer maintained doesn't mean you shouldn't use it, it means you should get off your a** and support it!!!

--

R.J. Townsend

Would you use it for your clients?

sk33lz's picture

You are telling me that you use unsupported modules for your clients? I may test out unmaintained modules on my own personal sites, but I would never suggest using an unsupported module for a paying client to anyone in this group, or otherwise. That is just asking for trouble.

I am a site builder, so I look for well maintained modules to use that get the job done. I haven't gotten into module development yet, and was merely suggesting something I found that might work. If you feel so inclined to do so, that is great, but please don't go around yelling at people telling them to maintain modules you suggested that are unmaintained.

Yes, I use "unsupported"

rj's picture

Yes, I use "unsupported" modules w/my clients, with the understanding that we'll support the module in-house (or donate $$ for a maintainer).
And since this is a project I'm working with Duran on, I have no problems recommending an unsupported module.

Sorry if I came off as yelling, that was never my intention; my point is that if you're using Drupal, you should give back, and if people need this module (which it looks like ~200 sites are using it), why not offer to support it???

--

R.J. Townsend

Perhaps this is more what you need?

sk33lz's picture

http://drupal.org/project/viewreference

You could create a specific field for the content type which allows specific sorting in a view, then associate the view with this module, instead of just the node.

The module itself recommends some other modules that might assist in setting up a process for this. Also, it has been updated in the last 2 months, and has 0 issues. Let's test this puppy out :)

I am installing it now. I seem to find a new, useful module every few days now.

Tricky Solution

pelicani's picture

What I've done in the past is use the cck multigroup module to do this ordering within a node.
First you have to find a copy of cck multigroup.
I used to be in the cck module, but has been deprecated.
Look on cck pre 6.2.3 i believe. If it isn't there let me know, I can give you the files.

Second, you create a multigroup on your content type.
Add you node reference into the group.
Set the group up to allow multiple, not the field, but the group.
Multigroup will let you associate the reference as before, but also provides a drag and drop mechanism for sorting.
Should give you what you need.

I may be missing something but...

will_kelly's picture

I think you can stop the scratching.

If I understand you correctly this should be easy. My biggest hurdles with views always get answered if I work in reverse.

You mentioned that the largest donors/sponsors need to come first (Sorting) for each event.(Referencing)

It appears as though you are trying to control the donors placement by the amount given. If that should be the basis for the view. The gold, silver, bronze is the relationship only for the image field you need to display.

Why not create a node type Sponsorship Ticket/Invoice? In that ticket you can reference the event and add the amount.

This way you can enter an event.

Keep sponsorships separate.

But display everything accordingly with views sorting.

Your event view should be pretty easy. Node type Sponsorship Ticket/Invoice. Sorted by amount. Argument of node ID. Display on Events.

A second thought is to make the sponsors a type of users and add the logo to the user profile. Then the user can login and become an event sponsor without any admin other than the setup of the event and the create sponsorship ticket permission.

Follow up, and potential solution.

alphex's picture

Ok, drupal is awesome, and sometimes awesome in its simple frustrations :)

I set NODE REFERENCE to allow me to select nodes by AUTO COMPLETE... which for some bizzare reason also gives it a SORT order . You can drag and drop order of things... which solves my problem... :facepalm:

Now I can do the view by passing the arguments I want in the order I want, or even just iterate out a NODE LOAD with each item I want.

Surprisingly easy.
Sometimes it just works out :)

Proof of concept worked, execution soon :)

Philadelphia Area

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: