Closed (fixed)
Project:
Viewfield
Version:
5.x-1.2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
22 Aug 2007 at 23:56 UTC
Updated:
29 Apr 2008 at 17:09 UTC
Jump to comment: Most recent file
Great module! How do I make it so that the user doesn't have a choice which view they use. In other words, when I create a content type I choose the view that shows up and no one can change in the module itself.
I'm not a coder - so if you've already got a way to do this please pass it on.
Thanks again
Simon
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | viewfield.module.txt | 5.68 KB | markfoodyburton |
| #6 | viewfield.zip_.txt | 20.22 KB | Bevan |
Comments
Comment #1
Bevan commentedWe're working on converting viewfield.module to do this. We were going to release it as a different module, seeing as it provides different functionality to viewfield, but this would essentially be a fork. To the maintainer of viewfield, do you think we could merge this into viewfield as a feature? There is a considerable amount of code in common.
Viewfield module could then provide two CCK field types; "Different view in each node", and "Different view in each node type".
We are working on a couple of bugs with our module right now, but I will upload a patch once we have it working smoothly.
WDYT?
Comment #2
thepanz commented+1 for this feature!
Comment #3
bobo commentedGreat! Thanks for that.
Comment #4
Bevan commentedWe have this working but are dealing with a bug to do with CCK field formatters. I'll post it here for testing when we get that fixed. Remind me if I forget...
Comment #5
looplog commentedanother hand up from the back of the class for this... any progress?
Comment #6
Bevan commentedPlease test the attached module. I haven't been very involved with the writing / code of this, but I'm using it successfully on a site. We're not sure if it would be best released as a separate module to viewfield, or integrated back in to viewfield to merge the features of each. Suggestions and ideas would be appreciated.
B/
Comment #7
looplog commentedI've given the module you attached a quick test and can't seem to get it to display anything. I just added a tracker view to a fresh content type as a test but nothing shows up. Am I missing something obvious?
Comment #8
Bevan commentedYou need to create a field using CCK, then possibly choose it's display type in the content type's display settings. Make sure the view you select works (and doesn't have an empty result set) independently first. If that doesn't work, try creating a field using the normal viewfield module, then swap it for this one, and repeat the above.
Bug fixes will be appreciated! :)
B/
Comment #9
looplog commentedok. I finally had some time to try the module in one of my existing test-sites which uses the older version and it works fine. Exactly what I was looking for. I'll be testing it out some more over this weekend and get back with any feedback.
Comment #10
markfoodyburton commentedSimple, straightforward, seems to work, please make this a module!
Comment #11
markfoodyburton commentedFor me, the following patch is important: http://drupal.org/node/165321
Attached is the module file from the above tar ball patched (by hand)....
Comment #12
Bevan commentedIt would be great if someone could adopt this and maintain it as a new project/module or integrate it back into viewfield.module (to provide two field types). We are no longer useing this code on the project we wrote it for so it is out of line to expect the client to fund our maintaining it, and AFAIK none of the team has a personal interest in it.
Hmmm, I wonder if this is GHOP-worthy?
Comment #13
markfoodyburton commentedI'll contact Mark, see what he thinks too
Comment #14
Bevan commentedhttp://groups.drupal.org/node/7739
Comment #15
jfall commented+1 - this would make a great addition to the viewfield module - exactly what I need.
There is a way to get some of this functionality without viewfield though, if you are using a template theme, at least...
theme('view', $view_name, $limit = NULL, $use_pager = NULL, $type = 'embed', $view_args = array())
(inside a PHP tag, of course, substituting the $arg parameters with the values you want);
Although this method does not actually provide an actual DB relationship between the node and the view, it does provide the desired output relationship. One drawback - you can only position the view before or after the node "content" - viewfield would allow much finer grain on where the view was actually rendered.
I hope that helps someone.
Comment #16
doc2@drupalfr.org commented+1 to committing this!
Comment #17
darren ohThis has been fixed for a while.