I have created a CCK field to embed a simpleviews widget into a node. The field then presents the Simpleviews widget to the node author to choose the view settings and displays the results in the node. You can add more than one simpleviews field to a content type if you like and have them filtering out different things.
I had to work out a system to rewrite the path for summary view links so that it would work in nodes, especially when using pathauto. I did that by passing the argument back as a query string in the url.
With this module and the two other patches I just posted, I can put two different simpleviews fields on a content type, set one up to use an argument and the other not and pass the argument so that only the view that needs it uses it. Multiple pagers on the same page should also be working correctly.
The Simpleviews overview form shows you the views created this way but won't let you edit or delete them directly, it links back to the node edit form instead.
This creates a nice, super simple, way for end users to create listing pages without any access to the admin section of the site. You could turn on Content Permissions to restrict access to the Simpleviews field.
Here it is if you're interested, I wasn't sure if you wanted to make this a part of the Simpleviews module or if you want me to create a separate project for it.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | simpleviewsfield.zip | 12.51 KB | karens |
| #2 | simpleviewsfield.zip | 5.04 KB | karens |
| #1 | simpleviewsfield.zip | 5.2 KB | karens |
Comments
Comment #1
karens commentedForgot the file :)
Comment #2
karens commentedOops, left some outdated stuff in that file, this is better.
Comment #3
karens commentedUpdated, latest, greatest version.
Comment #4
karens commentedI'm hoping that we can add #531544: Add summary views for arguments, the simpleviewsfield module assumes that is there. Probably won't break without it, but it is more useful if it gets in.
Comment #5
perandre commentedThanks! Good job. Now it's easier than ever for a client to make listings. The best thing about doing this in a field, is that you can link the page with the list to a menu item right there in the node edit interface, and no need to fiddle with urls. This helps usability.
Two minor issues:
1) When I set the field to Unlimited, it kind of looked like it wanted to add another view no matter what (it shows two forms on node edit).
2) When it's not set to be required, it still shows up. Could there be a check box to add the view when wanted? In case you don't want to make a seperate content type, but rather use it in a Page or similar.