Accordion with node style display
design.er - September 5, 2009 - 02:58
| Project: | Views Accordion |
| Version: | 6.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
Hello Manuel,
Thank you very much for this module. It's absolutely awesome! :)
Is there a way to include not only the field style but also node style display?
I thought it could use the node title as header and wrap the node content into the accordion body.
I'm not familiar with views so my feature request may be naive to you. If so, forgive me please. :)
Normally I use fields for my accordion views but this time I really need a node style display because the photos album does not integrate with views and I cannot show the slideshow other than via node style display.
Kind regards,
Stefan

#1
You can already get what you want with fields row style by using:
1. Node: Title.
2. Node: body or Node: teaser
As the fields added. This should get you the same. I haven't supported the node row style because I don't think there's much use here, but if other people request it I might think about it.
#2
Manuel, thank you for your reply.
Usually your suggestion is absolutely correct. I already use it and it works fine for me.
But this time I have to generate a view with all photos nodes added to the current group.
The problem is that photos adds a slideshow to the node but not inside the body but beneath it so I can't call it directly through the body field. It's sad but true.
That's why I thought it would make sense to handle it this way:
"Node: title" as accordion header and the rest of the node as accordion body.
Please feel free to tell me a better way if you know one. :) Otherwise a node view solution would be awesome.
There are also other scenarios where a node view support make sense instead of workarounds with fields -> a view with different node types where not every node type has the same fields and that's why no output so views has to render empty (already styled) fields with height margins etc. That's neither performance-friendly nor nice.
But this is an other scenario. :)
I really thank you for all your work on this module. I really love it! :)
Rock on!
Stefan
#3
No time atm to tackle this, I probably would need a day at least for implementing and testing it with most options so things wouldn't break.
On a sidenote, that module photos looks a bit scary, doesn't seem to be integrating with the rest of the drupal-sphere, looks like it tries to do everything itself. Not sure I would use it myself, you might want to try out other alternatives in the mean time, up to you of course ;)
#4
Thank you very much for your sidenote. I'm looking for an other media module - maybe I should try the new SSP Integration.
Yes, I believe that it would take a lot of time to implement and test this feature.
Anyways, I think it would be awesome to have a node view display for this module in the future - independent of the photos module and not in the next days, of course.
Please let me know if I can help you to test this feature.
Offtopic: I hope to get one of my current projects online in about 1 month where Views Accordion is one of the most important style modules to display summarized podcasts, galleries and contents in stylish ways. Unfortunately it's in German but nevertheless maybe you are interested to see the results or use it for reference of your nice module.
Kind regards,
Stefan
#5
Sure, drop the link in here once it's live =)
About choosing an alternative module, you may want to checkout these two links:
#6
OK, I had some time to look into this.
I'm attaching a patch that gets this done, with the garland theme. This is not ready for production, unless your node.tpl file outputs the titles as h2, and well, if your nodes don't have any more h2's in them.
The problem with this feature request, is that views cannot affect how your node rows are printed out. This is handled by the theme itself, and people can, and usually do, alter the way their nodes are printed. So I have no consistent way of selecting the titles to form the accordions. This is why I think this feature won't make it in, unless someone provides some insight into the problem.
The patch is made against the latest development version. I have made a new commit (http://drupal.org/cvs?commit=275608) fixing a small issue before this, so wait for the tarball to appear with today's date before downloading the dev version and testing this patch.
#7
Hi Manuel,
Thanks a lot for your work. I really appreciate it. :)
I'll take time and test your patch (hopefully already tonight).
Yes, you're absolutely right. I think it's not possible for views accordion to get sure the used node provides the required node field formatting and it's not its task (IMO). Users who want to use this feature should fit the requirements for styles and formats. There are also requirements for the field style display and users are willing to provide them so I think it will be OK in this case too. Maybe there will be a better way to handle this in the future but for now it should sufficient.
Again, thank you and will report back asap. :)
#8
Hi Manuel,
I tested the new patch and hey, it's awesome!!! :)) It works absolutely fine. I tested the scenario with overridden node-type.tpl.php files: It breaks when no node-div and h2 tag is provided as you said.
Do you want - if possible - to override the styling of the h2 tag? At the moment it is really big and contains a link to the node. For me this is not that problem, I can override this in my styles.css and node-type.tpl.php but I try to think more generic for other people without enough skills to do this or who don't want to override the h2 link in the node.tpl.php.
Thank you for your work. It's great to see it in action. :)
#9
Thanks for testing it design.er =)
Yup, the problem is that unless we figure out how to make views_accordion take control of that html for node row styles, this patch is not going to make it in. I make a pledge to support the code I provide, and it would be impossible to support this, since a lot of themes out there do things differently in their node tpl files.
So for now, the status is needs work. Perhaps mr. chaos can enlighten us a bit on this, or someone else, but for now it's not ready to be committed.
#10
Got a different approach to this issue here which allows views_accordion to add its own node titles and put them in its own html. Then the developer can hide the title on the actual node anyway they like (use CSS or edit its .tpl.php file)
The only reservation I have about this patch is that for accordions on node row style views it introduces a dependency on views 2.7 as some of the code from views_plugin_style render() has to go back into views_accordion so that the node titles can be loaded up and used as groupings.
Thanks for a useful module.
#11
Hi Alex,
Thank you very much for your work. It sounds interesting.
Unfortunately, I didn't have time to test the patch yet. Just for my understanding. Do I have to write a static title for every node or does it work with tokens or views/node $variables -> (token) [title-raw], (views) [title] or (node) $node->title?
Regards,
Stefan
#12
It'll just use whatever you've set the node's title to. There's no settings for this in the view it would be controlled from the node. If you want to use tokens in your node titles you can use http://drupal.org/project/auto_nodetitle
#13
No, that's cool as it is. I only wanted to know how it works. :)
Thank you! :)
#14
So, I found time to test the patch from #10. It seems to work fine so far. I couldn't notice any bugs.
I'm not sure why but there was no styling -> everything was just white - no borders, no colors as we know them from this module. Am I missing something or is it normal?
#15
There's an option in the views_accordian options to use your own styling or the modules. Maybe you have it set to not use the default view accordian styles? Is the css from the accordian module being loaded?